Bug 30846: (follow-up) Unit tests

Signed-off-by: Sam Lau <samalau@gmail.com>

Bug 30846: (Fix) Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Hammat Wele 2023-02-27 14:35:15 +00:00 committed by Tomas Cohen Arazi
parent a09a926458
commit 13d3e87503
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -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;
};