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 2115-2120
subtest 'Remove item from holds queue on checkout' => sub {
Link Here
|
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( { homebranch => $lib->branchcode, holdingbranch => $lib->branchcode, biblionumber => $item->biblionumber } ); |
2118 |
|
2119 |
|
2119 |
t::lib::Mocks::mock_userenv( { branchcode => $lib->branchcode } ); |
2120 |
t::lib::Mocks::mock_userenv( { branchcode => $lib->branchcode } ); |
2120 |
|
2121 |
|
Lines 2132-2146
subtest 'Remove item from holds queue on checkout' => sub {
Link Here
|
2132 |
|
2133 |
|
2133 |
is( |
2134 |
is( |
2134 |
Koha::Hold::HoldsQueueItems->search( { itemnumber => $item->id } )->count(), 1, |
2135 |
Koha::Hold::HoldsQueueItems->search( { itemnumber => $item->id } )->count(), 1, |
2135 |
"Item is found in the holds queue" |
2136 |
"One item is found in the holds queue" |
2136 |
); |
2137 |
); |
2137 |
|
2138 |
|
2138 |
AddIssue( $patron1, $item->barcode, dt_from_string ); |
2139 |
my $hq_item = Koha::Hold::HoldsQueueItems->search( { itemnumber => $item->id } )->next->item; |
|
|
2140 |
|
2141 |
AddIssue( $patron1, $hq_item->barcode, dt_from_string ); |
2139 |
|
2142 |
|
2140 |
is( |
2143 |
is( |
2141 |
Koha::Hold::HoldsQueueItems->search( { itemnumber => $item->id } )->count(), 0, |
2144 |
Koha::Hold::HoldsQueueItems->search( { itemnumber => $item->id } )->count(), 0, |
2142 |
"Item is no longer found in the holds queue" |
2145 |
"Item is no longer found in the holds queue" |
2143 |
); |
2146 |
); |
2144 |
|
2147 |
|
|
|
2148 |
C4::HoldsQueue::CreateQueue(); |
2149 |
|
2150 |
is( |
2151 |
Koha::Hold::HoldsQueueItems->search( { itemnumber => $item2->id } )->count(), 1, |
2152 |
"One item is found in the holds queue" |
2153 |
); |
2154 |
|
2155 |
my $hq_item2 = Koha::Hold::HoldsQueueItems->search( { itemnumber => $item2->id } )->next->item; |
2156 |
isnt( $hq_item->id, $hq_item2->id, "Item now targetd by the holds queue is not the same item." ); |
2157 |
|
2145 |
$schema->storage->txn_rollback; |
2158 |
$schema->storage->txn_rollback; |
2146 |
}; |
2159 |
}; |
2147 |
- |
|
|