View | Details | Raw Unified | Return to bug 34678
Collapse All | Expand All

(-)a/t/db_dependent/Reserves.t (-4 / +19 lines)
Lines 1764-1770 subtest 'DefaultHoldExpiration tests' => sub { Link Here
1764
};
1764
};
1765
1765
1766
subtest '_Findgroupreserves' => sub {
1766
subtest '_Findgroupreserves' => sub {
1767
    plan tests => 4;
1767
    plan tests => 6;
1768
    $schema->storage->txn_begin;
1768
    $schema->storage->txn_begin;
1769
1769
1770
    my $patron_1 = $builder->build_object( { class => 'Koha::Patrons' } );
1770
    my $patron_1 = $builder->build_object( { class => 'Koha::Patrons' } );
Lines 1791-1798 subtest '_Findgroupreserves' => sub { Link Here
1791
    C4::HoldsQueue::AddToHoldTargetMap(
1791
    C4::HoldsQueue::AddToHoldTargetMap(
1792
        {
1792
        {
1793
            $item->id => {
1793
            $item->id => {
1794
                borrowernumber => $patron_1->id, biblionumber => $item->biblionumber,
1794
                borrowernumber => $patron_1->id,        biblionumber => $item->biblionumber,
1795
                holdingbranch  => $item->holdingbranch, item_level => 0, reserve_id => $reserve_id_1
1795
                holdingbranch  => $item->holdingbranch, item_level   => 0, reserve_id => $reserve_id_1
1796
            }
1796
            }
1797
        }
1797
        }
1798
    );
1798
    );
Lines 1816-1821 subtest '_Findgroupreserves' => sub { Link Here
1816
    is( scalar @reserves,           1,             "We should only get the item level hold that is in the map" );
1816
    is( scalar @reserves,           1,             "We should only get the item level hold that is in the map" );
1817
    is( $reserves[0]->{reserve_id}, $reserve_id_2, "We got the expected reserve" );
1817
    is( $reserves[0]->{reserve_id}, $reserve_id_2, "We got the expected reserve" );
1818
1818
1819
    C4::HoldsQueue::AddToHoldTargetMap(
1820
        {
1821
            $item_2->id => {
1822
                borrowernumber => $patron_2->id, biblionumber => $item->biblionumber,
1823
                holdingbranch  => $item->holdingbranch, item_level => 1, reserve_id => $reserve_id_1
1824
            }
1825
        }
1826
    );
1827
1828
    # When the hold is title level and in the hold fill targets we expect this to be the only hold returned
1829
    @reserves = C4::Reserves::_Findgroupreserve( $item->biblionumber, $item_2->id, 0, [] );
1830
    is( scalar @reserves,           1,             "We should still only get the item level hold that is in the map" );
1831
    is( $reserves[0]->{reserve_id}, $reserve_id_1, "We got the expected reserve which has been updated" );
1832
1833
1834
1819
    $schema->txn_rollback;
1835
    $schema->txn_rollback;
1820
};
1836
};
1821
1837
1822
- 

Return to bug 34678