From 13d3e87503232201b4cfae15dd3a8c6e39a6e44b Mon Sep 17 00:00:00 2001 From: Hammat Wele Date: Mon, 27 Feb 2023 14:35:15 +0000 Subject: [PATCH] Bug 30846: (follow-up) Unit tests Signed-off-by: Sam Lau Bug 30846: (Fix) Unit tests Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/Reserves.t | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t index 2d97fa43a1..7e2d83e50e 100755 --- a/t/db_dependent/Reserves.t +++ b/t/db_dependent/Reserves.t @@ -1452,7 +1452,7 @@ $schema->storage->txn_rollback(); subtest 'IsAvailableForItemLevelRequest() tests' => sub { - plan tests => 2; + plan tests => 3; $schema->storage->txn_begin; @@ -1484,6 +1484,21 @@ subtest 'IsAvailableForItemLevelRequest() tests' => sub { "Item not available for item-level hold because no effective item type" ); + Koha::CirculationRules->set_rules( + { + categorycode => '*', + itemtype => '*', + branchcode => '*', + rules => { + onshelfholds => 0, + } + } + ); + my $item_1 = $builder->build_sample_item( { notforloan => -1 } ); + ok( + C4::Reserves::IsAvailableForItemLevelRequest( $item_1, $patron ), + "We can placing hold on item with negative not for loan values when 'On shelf holds allowed' is set to 'If any unavailable'" + ); $schema->storage->txn_rollback; }; -- 2.39.2