Lines 146-152
$schema->storage->txn_rollback();
Link Here
|
146 |
|
146 |
|
147 |
subtest "store() tests" => sub { |
147 |
subtest "store() tests" => sub { |
148 |
|
148 |
|
149 |
plan tests => 6; |
149 |
plan tests => 7; |
150 |
|
150 |
|
151 |
$schema->storage->txn_begin(); |
151 |
$schema->storage->txn_begin(); |
152 |
|
152 |
|
Lines 241-246
subtest "store() tests" => sub {
Link Here
|
241 |
is( $hold->expirationdate, |
241 |
is( $hold->expirationdate, |
242 |
$expected_date, 'Expiration date set after reverting holds waiting status.' ); |
242 |
$expected_date, 'Expiration date set after reverting holds waiting status.' ); |
243 |
|
243 |
|
|
|
244 |
my $patron_expiration_date = dt_from_string('2023-11-06')->ymd; |
245 |
$hold = Koha::Hold->new( |
246 |
{ |
247 |
biblionumber => $biblio->biblionumber, |
248 |
itemnumber => $item->id, |
249 |
reservedate => '2023-10-15', |
250 |
expirationdate => $patron_expiration_date, |
251 |
waitingdate => '2023-10-15', |
252 |
borrowernumber => $borrower->borrowernumber, |
253 |
branchcode => $library->branchcode, |
254 |
suspend => 0, |
255 |
patron_expiration_date => $patron_expiration_date, |
256 |
} |
257 |
)->store; |
258 |
$hold->discard_changes; |
259 |
|
260 |
$hold->set_waiting; |
261 |
C4::Reserves::RevertWaitingStatus( |
262 |
{ itemnumber => $item->itemnumber } |
263 |
); |
264 |
$hold->discard_changes; |
265 |
|
266 |
is( $hold->expirationdate, |
267 |
$patron_expiration_date, 'Expiration date set same as patron_expiration_date after reverting holds waiting status.' ); |
268 |
|
244 |
$schema->storage->txn_rollback(); |
269 |
$schema->storage->txn_rollback(); |
245 |
}; |
270 |
}; |
246 |
|
271 |
|
247 |
- |
|
|