From 0c1d646b0baf91f99912ba22b2c78ea3a0e440e1 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 22 Sep 2023 14:59:54 +0200 Subject: [PATCH] Bug 34842: Fix Illrequest/Config.t if DB upgraded twice Not sure this is correct, but I think it is! --- Koha/Illrequest/Config.pm | 1 - t/db_dependent/Illrequest/Config.t | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Koha/Illrequest/Config.pm b/Koha/Illrequest/Config.pm index 84f4067df34..fa035e1b755 100644 --- a/Koha/Illrequest/Config.pm +++ b/Koha/Illrequest/Config.pm @@ -255,7 +255,6 @@ sub _load_configuration { limits => {}, digital_recipients => {}, prefixes => {}, - partner_code => 'IL', raw_config => $xml_config, }; diff --git a/t/db_dependent/Illrequest/Config.t b/t/db_dependent/Illrequest/Config.t index ae1535ef774..1034abbec20 100755 --- a/t/db_dependent/Illrequest/Config.t +++ b/t/db_dependent/Illrequest/Config.t @@ -44,6 +44,7 @@ subtest 'Basics' => sub { $schema->storage->txn_begin; t::lib::Mocks::mock_config("interlibrary_loans", {}); + t::lib::Mocks::mock_preference('ILLPartnerCode', undef); my $config = Koha::Illrequest::Config->new; isa_ok($config, "Koha::Illrequest::Config", @@ -60,7 +61,7 @@ subtest 'Basics' => sub { is($config->backend_dir, "/tmp/", "backend_dir: setter is persistent."); # partner_code: - is($config->partner_code, "IL", "partner_code: Undefined partner_code is undefined."); + is($config->partner_code, 'IL', "partner_code: Undefined partner_code fallback to 'IL'."); is($config->partner_code("ILTST"), "ILTST", "partner_code: setter works."); is($config->partner_code, "ILTST", "partner_code: setter is persistent."); @@ -198,6 +199,7 @@ subtest '_load_configuration' => sub { $schema->storage->txn_begin; my $config = Koha::Illrequest::Config->new; + t::lib::Mocks::mock_preference('ILLPartnerCode', 'IL'); # Return basic configuration is_deeply( -- 2.25.1