From 9184e2e734379f04063734bd9489e33a56d15a8d 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 (cherry picked from commit 13d3e87503232201b4cfae15dd3a8c6e39a6e44b) Signed-off-by: Fridolin Somers (cherry picked from commit f5f4f8097720de08a22adb55b28809900163a0da) Signed-off-by: Pedro Amorim --- 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 e64393154e..809e92a2d0 100755 --- a/t/db_dependent/Reserves.t +++ b/t/db_dependent/Reserves.t @@ -1455,7 +1455,7 @@ $schema->storage->txn_rollback(); subtest 'IsAvailableForItemLevelRequest() tests' => sub { - plan tests => 2; + plan tests => 3; $schema->storage->txn_begin; @@ -1487,6 +1487,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.5