From d75cf90c5bacbc085525f157d40579bedf3559b4 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 8 Oct 2021 15:05:39 +0200 Subject: [PATCH] Bug 3142: Add tests for item-level_itypes=0 Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart (cherry picked from commit f2c7c9430bb4a38b80e954599bc090dfb04f3674) Signed-off-by: Andrew Fuerste-Henry --- t/db_dependent/Koha/Items.t | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha/Items.t b/t/db_dependent/Koha/Items.t index 6aff277497..5a1586b877 100755 --- a/t/db_dependent/Koha/Items.t +++ b/t/db_dependent/Koha/Items.t @@ -1471,7 +1471,7 @@ subtest 'can_be_transferred' => sub { }; subtest 'filter_by_for_hold' => sub { - plan tests => 11; + plan tests => 12; my $biblio = $builder->build_sample_biblio; is( $biblio->items->filter_by_for_hold->count, 0, 'no item yet' ); @@ -1528,6 +1528,12 @@ subtest 'filter_by_for_hold' => sub { $itemtype->notforloan(1)->store; is( $biblio->items->filter_by_for_hold->count, 6, '6 items for hold - notforloan' ); + t::lib::Mocks::mock_preference('item-level_itypes', 0); + $biblio->biblioitem->itemtype($not_holdable_itemtype)->store; + is( $biblio->items->filter_by_for_hold->count, 0, '0 item-level_itypes=0' ); + + t::lib::Mocks::mock_preference('item-level_itypes', 1); + $biblio->delete; }; -- 2.39.5