Lines 160-166
$schema->storage->txn_rollback();
Link Here
|
160 |
|
160 |
|
161 |
subtest "store() tests" => sub { |
161 |
subtest "store() tests" => sub { |
162 |
|
162 |
|
163 |
plan tests => 7; |
163 |
plan tests => 8; |
164 |
|
164 |
|
165 |
$schema->storage->txn_begin(); |
165 |
$schema->storage->txn_begin(); |
166 |
|
166 |
|
Lines 292-297
subtest "store() tests" => sub {
Link Here
|
292 |
'Expiration date set same as patron_expiration_date after reverting holds waiting status.' |
292 |
'Expiration date set same as patron_expiration_date after reverting holds waiting status.' |
293 |
); |
293 |
); |
294 |
|
294 |
|
|
|
295 |
# Do not set expiration date for hold if no period is set |
296 |
t::lib::Mocks::mock_preference( 'DefaultHoldExpirationdatePeriod', '' ); |
297 |
$hold = Koha::Hold->new( |
298 |
{ |
299 |
biblionumber => $biblio->biblionumber, |
300 |
itemnumber => $item->id, |
301 |
reservedate => '2022-12-14', |
302 |
waitingdate => '2022-12-14', |
303 |
borrowernumber => $borrower->borrowernumber, |
304 |
branchcode => $library->branchcode, |
305 |
suspend => 0, |
306 |
} |
307 |
)->store; |
308 |
$hold->discard_changes; |
309 |
|
310 |
is( |
311 |
$hold->expirationdate, |
312 |
undef, 'Expiration date not set if "DefaultHoldExpirationdatePeriod" is left empty.' |
313 |
); |
314 |
|
295 |
$schema->storage->txn_rollback(); |
315 |
$schema->storage->txn_rollback(); |
296 |
}; |
316 |
}; |
297 |
|
317 |
|
298 |
- |
|
|