|
Lines 274-280
subtest 'get_opacitemholds_policy' => sub {
Link Here
|
| 274 |
is ( $opacitemholds, 'Y', 'Patrons can place a hold on this itype'); |
274 |
is ( $opacitemholds, 'Y', 'Patrons can place a hold on this itype'); |
| 275 |
t::lib::Mocks::mock_preference('item-level_itypes', 0); |
275 |
t::lib::Mocks::mock_preference('item-level_itypes', 0); |
| 276 |
$opacitemholds = Koha::IssuingRules->get_opacitemholds_policy( { item => $item, patron => $patron } ); |
276 |
$opacitemholds = Koha::IssuingRules->get_opacitemholds_policy( { item => $item, patron => $patron } ); |
| 277 |
is ( $opacitemholds, '', 'Patrons cannot place a hold on this itemtype'); |
277 |
is ( $opacitemholds, 'N', 'Patrons cannot place a hold on this itemtype'); |
| 278 |
|
278 |
|
| 279 |
Koha::IssuingRules->delete; |
279 |
Koha::IssuingRules->delete; |
| 280 |
Koha::IssuingRule->new({categorycode => '*', itemtype => '*', branchcode => '*', opacitemholds => "N"})->store; |
280 |
Koha::IssuingRule->new({categorycode => '*', itemtype => '*', branchcode => '*', opacitemholds => "N"})->store; |
|
Lines 282-288
subtest 'get_opacitemholds_policy' => sub {
Link Here
|
| 282 |
Koha::IssuingRule->new({categorycode => '*', itemtype => $itemtype->itemtype, branchcode => '*', opacitemholds => "Y"})->store; |
282 |
Koha::IssuingRule->new({categorycode => '*', itemtype => $itemtype->itemtype, branchcode => '*', opacitemholds => "Y"})->store; |
| 283 |
t::lib::Mocks::mock_preference('item-level_itypes', 1); |
283 |
t::lib::Mocks::mock_preference('item-level_itypes', 1); |
| 284 |
$opacitemholds = Koha::IssuingRules->get_opacitemholds_policy( { item => $item, patron => $patron } ); |
284 |
$opacitemholds = Koha::IssuingRules->get_opacitemholds_policy( { item => $item, patron => $patron } ); |
| 285 |
is ( $opacitemholds, '', 'Patrons cannot place a hold on this itype'); |
285 |
is ( $opacitemholds, 'N', 'Patrons cannot place a hold on this itype'); |
| 286 |
t::lib::Mocks::mock_preference('item-level_itypes', 0); |
286 |
t::lib::Mocks::mock_preference('item-level_itypes', 0); |
| 287 |
$opacitemholds = Koha::IssuingRules->get_opacitemholds_policy( { item => $item, patron => $patron } ); |
287 |
$opacitemholds = Koha::IssuingRules->get_opacitemholds_policy( { item => $item, patron => $patron } ); |
| 288 |
is ( $opacitemholds, 'Y', 'Patrons can place a hold on this itemtype'); |
288 |
is ( $opacitemholds, 'Y', 'Patrons can place a hold on this itemtype'); |
| 289 |
- |
|
|