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 => 5; |
149 |
plan tests => 6; |
150 |
|
150 |
|
151 |
$schema->storage->txn_begin(); |
151 |
$schema->storage->txn_begin(); |
152 |
|
152 |
|
Lines 222-227
subtest "store() tests" => sub {
Link Here
|
222 |
is( $hold->expirationdate, |
222 |
is( $hold->expirationdate, |
223 |
$passed_date->ymd, 'Passed expiration date when updating hold correctly set (Passing both reservedate and expirationdate.' ); |
223 |
$passed_date->ymd, 'Passed expiration date when updating hold correctly set (Passing both reservedate and expirationdate.' ); |
224 |
|
224 |
|
|
|
225 |
# Do not set expiration date for hold if no period is set |
226 |
t::lib::Mocks::mock_preference( 'DefaultHoldExpirationdatePeriod', '' ); |
227 |
$hold = Koha::Hold->new( |
228 |
{ |
229 |
biblionumber => $biblio->biblionumber, |
230 |
itemnumber => $item->id, |
231 |
reservedate => '2022-12-14', |
232 |
waitingdate => '2022-12-14', |
233 |
borrowernumber => $borrower->borrowernumber, |
234 |
branchcode => $library->branchcode, |
235 |
suspend => 0, |
236 |
} |
237 |
)->store; |
238 |
$hold->discard_changes; |
239 |
|
240 |
is( $hold->expirationdate, |
241 |
undef, 'Expiration date not set if "DefaultHoldExpirationdatePeriod" is left empty.' ); |
242 |
|
225 |
$schema->storage->txn_rollback(); |
243 |
$schema->storage->txn_rollback(); |
226 |
}; |
244 |
}; |
227 |
|
245 |
|
228 |
- |
|
|