Lines 1510-1516
subtest 'can_be_transferred' => sub {
Link Here
|
1510 |
}; |
1510 |
}; |
1511 |
|
1511 |
|
1512 |
subtest 'filter_by_for_hold' => sub { |
1512 |
subtest 'filter_by_for_hold' => sub { |
1513 |
plan tests => 8; |
1513 |
plan tests => 9; |
1514 |
|
1514 |
|
1515 |
my $biblio = $builder->build_sample_biblio; |
1515 |
my $biblio = $builder->build_sample_biblio; |
1516 |
is( $biblio->items->filter_by_for_hold->count, 0, 'no item yet' ); |
1516 |
is( $biblio->items->filter_by_for_hold->count, 0, 'no item yet' ); |
Lines 1536-1541
subtest 'filter_by_for_hold' => sub {
Link Here
|
1536 |
t::lib::Mocks::mock_preference('AllowHoldsOnDamagedItems', 1); |
1536 |
t::lib::Mocks::mock_preference('AllowHoldsOnDamagedItems', 1); |
1537 |
is( $biblio->items->filter_by_for_hold->count, 6, '6 items for hold - damaged if AllowHoldsOnDamagedItems' ); |
1537 |
is( $biblio->items->filter_by_for_hold->count, 6, '6 items for hold - damaged if AllowHoldsOnDamagedItems' ); |
1538 |
|
1538 |
|
|
|
1539 |
my $not_holdable_itemtype = $builder->build_object({ class => 'Koha::ItemTypes' })->itemtype; |
1540 |
$builder->build_sample_item( |
1541 |
{ |
1542 |
biblionumber => $biblio->biblionumber, |
1543 |
itype => $not_holdable_itemtype, |
1544 |
} |
1545 |
); |
1546 |
Koha::CirculationRules->set_rule( |
1547 |
{ |
1548 |
branchcode => undef, |
1549 |
itemtype => $not_holdable_itemtype, |
1550 |
rule_name => 'holdallowed', |
1551 |
rule_value => 'not_allowed', |
1552 |
} |
1553 |
); |
1554 |
is( $biblio->items->filter_by_for_hold->count, 6, '6 items for hold - holdallowed=not_allowed' ); |
1555 |
|
1539 |
$biblio->delete; |
1556 |
$biblio->delete; |
1540 |
}; |
1557 |
}; |
1541 |
|
1558 |
|
1542 |
- |
|
|