From 567cc2e1a9e3038b36a193c7e98a156d3d2dc757 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 --- 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 9a951d7e4f..dc258b4510 100755 --- a/t/db_dependent/Koha/Items.t +++ b/t/db_dependent/Koha/Items.t @@ -1510,7 +1510,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' ); @@ -1567,6 +1567,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.20.1