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

(-)a/t/db_dependent/HoldsQueue.t (-5 / +18 lines)
Lines 2095-2101 subtest "GetItemsAvailableToFillHoldsRequestsForBib" => sub { Link Here
2095
2095
2096
subtest 'Remove item from holds queue on checkout' => sub {
2096
subtest 'Remove item from holds queue on checkout' => sub {
2097
2097
2098
    plan tests => 2;
2098
    plan tests => 4;
2099
2099
2100
    $schema->storage->txn_begin;
2100
    $schema->storage->txn_begin;
2101
2101
Lines 2114-2120 subtest 'Remove item from holds queue on checkout' => sub { Link Here
2114
        }
2114
        }
2115
    );
2115
    );
2116
2116
2117
    my $item = $builder->build_sample_item( { homebranch => $lib->branchcode, holdingbranch => $lib->branchcode } );
2117
    my $item  = $builder->build_sample_item( { homebranch => $lib->branchcode, holdingbranch => $lib->branchcode } );
2118
    my $item2 = $builder->build_sample_item(
2119
        { homebranch => $lib->branchcode, holdingbranch => $lib->branchcode, biblionumber => $item->biblionumber } );
2118
2120
2119
    t::lib::Mocks::mock_userenv( { branchcode => $lib->branchcode } );
2121
    t::lib::Mocks::mock_userenv( { branchcode => $lib->branchcode } );
2120
2122
Lines 2132-2146 subtest 'Remove item from holds queue on checkout' => sub { Link Here
2132
2134
2133
    is(
2135
    is(
2134
        Koha::Hold::HoldsQueueItems->search( { itemnumber => $item->id } )->count(), 1,
2136
        Koha::Hold::HoldsQueueItems->search( { itemnumber => $item->id } )->count(), 1,
2135
        "Item is found in the holds queue"
2137
        "One item is found in the holds queue"
2136
    );
2138
    );
2137
2139
2138
    AddIssue( $patron1, $item->barcode, dt_from_string );
2140
    my $hq_item = Koha::Hold::HoldsQueueItems->search( { itemnumber => $item->id } )->next->item;
2141
2142
    AddIssue( $patron1, $hq_item->barcode, dt_from_string );
2139
2143
2140
    is(
2144
    is(
2141
        Koha::Hold::HoldsQueueItems->search( { itemnumber => $item->id } )->count(), 0,
2145
        Koha::Hold::HoldsQueueItems->search( { itemnumber => $item->id } )->count(), 0,
2142
        "Item is no longer found in the holds queue"
2146
        "Item is no longer found in the holds queue"
2143
    );
2147
    );
2144
2148
2149
    C4::HoldsQueue::CreateQueue();
2150
2151
    is(
2152
        Koha::Hold::HoldsQueueItems->search( { itemnumber => $item2->id } )->count(), 1,
2153
        "One item is found in the holds queue"
2154
    );
2155
2156
    my $hq_item2 = Koha::Hold::HoldsQueueItems->search( { itemnumber => $item2->id } )->next->item;
2157
    isnt( $hq_item->id, $hq_item2->id, "Item now targetd by the holds queue is not the same item." );
2158
2145
    $schema->storage->txn_rollback;
2159
    $schema->storage->txn_rollback;
2146
};
2160
};
2147
- 

Return to bug 35357