From 5fc0bc73f5f01b3f58e088a7e63e01cc15bd5f1a Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 20 Apr 2023 06:41:32 +0000 Subject: [PATCH] Bug 33567: Empty NFL_statuses pref in unit test Content-Type: text/plain; charset=utf-8 This test should fail now, since it would trigger the hardcoded fallback in the XSLT module. Test plan: Run t/db_dependent/XSLT.t Should fail. Signed-off-by: Marcel de Rooy --- t/db_dependent/XSLT.t | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/XSLT.t b/t/db_dependent/XSLT.t index c4013aed2f..00c5ed52d7 100755 --- a/t/db_dependent/XSLT.t +++ b/t/db_dependent/XSLT.t @@ -37,7 +37,7 @@ my $builder = t::lib::TestBuilder->new; $schema->storage->txn_begin; subtest 'buildKohaItemsNamespace status tests' => sub { - plan tests => 17; + plan tests => 18; t::lib::Mocks::mock_preference('Reference_NFL_Statuses', '1|2'); t::lib::Mocks::mock_preference( 'OPACResultsLibrary', 'holdingbranch' ); @@ -83,6 +83,9 @@ subtest 'buildKohaItemsNamespace status tests' => sub { t::lib::Mocks::mock_preference('Reference_NFL_Statuses', '2'); $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); like($xml,qr{reallynotforloan},"reallynotforloan when we change Reference_NFL_Statuses"); + t::lib::Mocks::mock_preference('Reference_NFL_Statuses', q{}); # empty, same effect + $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); + like($xml,qr{reallynotforloan},"reallynotforloan when we empty Reference_NFL_Statuses"); t::lib::Mocks::mock_preference('Reference_NFL_Statuses', '1|2'); } -- 2.30.2