Lines 1468-1488
subtest 'IsAvailableForItemLevelRequest() tests' => sub {
Link Here
|
1468 |
"Item not available for item-level hold because no effective item type" |
1468 |
"Item not available for item-level hold because no effective item type" |
1469 |
); |
1469 |
); |
1470 |
|
1470 |
|
1471 |
Koha::CirculationRules->set_rules( |
|
|
1472 |
{ |
1473 |
categorycode => '*', |
1474 |
itemtype => '*', |
1475 |
branchcode => '*', |
1476 |
rules => { |
1477 |
onshelfholds => 0, |
1478 |
} |
1479 |
} |
1480 |
); |
1481 |
my $item_1 = $builder->build_sample_item( { notforloan => -1 } ); |
1482 |
ok( |
1471 |
ok( |
1483 |
C4::Reserves::IsAvailableForItemLevelRequest( $item_1, $patron ), |
1472 |
!C4::Reserves::IsAvailableForItemLevelRequest( $item, undef ), |
1484 |
"We can placing hold on item with negative not for loan values when 'On shelf holds allowed' is set to 'If any unavailable'" |
1473 |
"Item not available for item-level hold because no patron defined" |
1485 |
); |
1474 |
); |
|
|
1475 |
|
1486 |
$schema->storage->txn_rollback; |
1476 |
$schema->storage->txn_rollback; |
1487 |
}; |
1477 |
}; |
1488 |
|
1478 |
|
Lines 1590-1596
subtest 'AlterPriorty() tests' => sub {
Link Here
|
1590 |
|
1580 |
|
1591 |
subtest 'CanBookBeReserved() tests' => sub { |
1581 |
subtest 'CanBookBeReserved() tests' => sub { |
1592 |
|
1582 |
|
1593 |
plan tests => 2; |
1583 |
plan tests => 3; |
1594 |
|
1584 |
|
1595 |
$schema->storage->txn_begin; |
1585 |
$schema->storage->txn_begin; |
1596 |
|
1586 |
|
Lines 1661-1666
subtest 'CanBookBeReserved() tests' => sub {
Link Here
|
1661 |
{ itemtype => $itype->id } ); |
1651 |
{ itemtype => $itype->id } ); |
1662 |
is_deeply( $res, { status => '' }, 'Holds on itemtype limit reached' ); |
1652 |
is_deeply( $res, { status => '' }, 'Holds on itemtype limit reached' ); |
1663 |
|
1653 |
|
|
|
1654 |
$res = CanBookBeReserved( undef, $biblio->id, $library->id, |
1655 |
{ itemtype => $itype->id } ); |
1656 |
is_deeply( $res, { status => '' }, 'Patron id undefined' ); |
1657 |
|
1664 |
$schema->storage->txn_rollback; |
1658 |
$schema->storage->txn_rollback; |
1665 |
}; |
1659 |
}; |
1666 |
|
1660 |
|
1667 |
- |
|
|