From 1ca21fabb2a521b6c206b85e3f1feaffb2380e75 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 4 Sep 2023 08:50:52 -0300 Subject: [PATCH] Bug 32911: (QA follow-up) Adjust tests This patch adjusts tests so they acknowledge the new syspref and the fact `partner_code` will be skipped if found on the config file. Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/Illrequest/Config.t | 33 +++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/t/db_dependent/Illrequest/Config.t b/t/db_dependent/Illrequest/Config.t index 8baa624234c..ae1535ef774 100755 --- a/t/db_dependent/Illrequest/Config.t +++ b/t/db_dependent/Illrequest/Config.t @@ -193,7 +193,7 @@ subtest '_load_unit_config' => sub { subtest '_load_configuration' => sub { - plan tests => 9; + plan tests => 10; $schema->storage->txn_begin; @@ -388,20 +388,39 @@ subtest '_load_configuration' => sub { # Partner library category is_deeply( - Koha::Illrequest::Config::_load_configuration({ partner_code => 'FOOBAR' }), + Koha::Illrequest::Config::_load_configuration( { partner_code => 'FOOBAR' } ), { - backend_directory => undef, - censorship => { + backend_directory => undef, + censorship => { censor_notes_staff => 0, - censor_reply_date => 0, + censor_reply_date => 0, }, limits => {}, digital_recipients => {}, prefixes => {}, - partner_code => 'FOOBAR', + partner_code => 'IL', raw_config => { partner_code => 'FOOBAR' }, }, - "load_configuration: Set partner code." + q{'partner_code' not read from the config file, default value 'IL' used instead} + ); + + t::lib::Mocks::mock_preference( 'ILLPartnerCode', 'FOOBAR' ); + + is_deeply( + Koha::Illrequest::Config::_load_configuration(), + { + backend_directory => undef, + censorship => { + censor_notes_staff => 0, + censor_reply_date => 0, + }, + limits => {}, + digital_recipients => {}, + prefixes => {}, + partner_code => 'FOOBAR', + raw_config => {}, + }, + q{'ILLPartnerCode' takes precedence over default value for 'partner_code'} ); $schema->storage->txn_rollback; -- 2.42.0