|
Lines 1776-1782
subtest 'DefaultHoldExpiration tests' => sub {
Link Here
|
| 1776 |
}; |
1776 |
}; |
| 1777 |
|
1777 |
|
| 1778 |
subtest '_Findgroupreserves' => sub { |
1778 |
subtest '_Findgroupreserves' => sub { |
| 1779 |
plan tests => 4; |
1779 |
plan tests => 6; |
| 1780 |
$schema->storage->txn_begin; |
1780 |
$schema->storage->txn_begin; |
| 1781 |
|
1781 |
|
| 1782 |
my $patron_1 = $builder->build_object( { class => 'Koha::Patrons' } ); |
1782 |
my $patron_1 = $builder->build_object( { class => 'Koha::Patrons' } ); |
|
Lines 1828-1832
subtest '_Findgroupreserves' => sub {
Link Here
|
| 1828 |
is( scalar @reserves, 1, "We should only get the item level hold that is in the map" ); |
1828 |
is( scalar @reserves, 1, "We should only get the item level hold that is in the map" ); |
| 1829 |
is( $reserves[0]->{reserve_id}, $reserve_id_2, "We got the expected reserve" ); |
1829 |
is( $reserves[0]->{reserve_id}, $reserve_id_2, "We got the expected reserve" ); |
| 1830 |
|
1830 |
|
|
|
1831 |
C4::HoldsQueue::AddToHoldTargetMap( |
| 1832 |
{ |
| 1833 |
$item_2->id => { |
| 1834 |
borrowernumber => $patron_2->id, biblionumber => $item->biblionumber, |
| 1835 |
holdingbranch => $item->holdingbranch, item_level => 1, reserve_id => $reserve_id_1 |
| 1836 |
} |
| 1837 |
} |
| 1838 |
); |
| 1839 |
|
| 1840 |
# When the hold is title level and in the hold fill targets we expect this to be the only hold returned |
| 1841 |
@reserves = C4::Reserves::_Findgroupreserve( $item->biblionumber, $item_2->id, 0, [] ); |
| 1842 |
is( scalar @reserves, 1, "We should still only get the item level hold that is in the map" ); |
| 1843 |
is( $reserves[0]->{reserve_id}, $reserve_id_1, "We got the expected reserve which has been updated" ); |
| 1844 |
|
| 1845 |
|
| 1846 |
|
| 1831 |
$schema->txn_rollback; |
1847 |
$schema->txn_rollback; |
| 1832 |
}; |
1848 |
}; |
| 1833 |
- |
|
|