From 97307b881d3b718776f5bd47cb83870ce3127062 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! Signed-off-by: Pedro Amorim Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- 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 84f4067df3..fa035e1b75 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 ae1535ef77..1034abbec2 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.39.5