- Koha::CirculationRules->set_rules(
- {
- branchcode => undef,
- categorycode => undef,
- itemtype => undef,
- rules => {
- reservesallowed => 25,
- opacitemholds => 'Y',
- onshelfholds => '0',
- }
- });
-
- $canreserve = C4::Reserves::CanItemBeReserved(
- $patron->borrowernumber,
- $item->itemnumber,
- );
-
- is( $canreserve->{status}, 'onShelfHoldsNotAllowed',
- 'item-level holds should not be possible with onshelfholdallowed set to "If any unavailable"' );
-
- Koha::CirculationRules->set_rules(
- {
- branchcode => undef,
- categorycode => undef,
- itemtype => undef,
- rules => {
- reservesallowed => 25,
- opacitemholds => 'Y',
- onshelfholds => '2',
- }
- });
-
- $canreserve = C4::Reserves::CanItemBeReserved(
- $patron->borrowernumber,
- $item->itemnumber,
- );
-
- is( $canreserve->{status}, 'onShelfHoldsNotAllowed',
- 'item-level holds should not be possible with onshelfholdallowed set to "If all unavailable"' );