From 5ab42dc09fe92cee4600ee683397f7d6b1337738 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 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 Signed-off-by: Jonathan Druart --- 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 c4013aed2fb..00c5ed52d76 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.25.1