|
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 |
$passed_date = dt_from_string('2023-06-20'); |
| 226 |
$hold->set( |
| 227 |
{ |
| 228 |
reservedate => $passed_date->ymd, |
| 229 |
waitingdate => $passed_date->ymd, |
| 230 |
} |
| 231 |
)->store(); |
| 232 |
$hold->discard_changes; |
| 233 |
|
| 234 |
$hold->set_waiting; |
| 235 |
C4::Reserves::RevertWaitingStatus( |
| 236 |
{ itemnumber => $item->itemnumber } |
| 237 |
); |
| 238 |
$hold->discard_changes; |
| 239 |
|
| 240 |
$expected_date = dt_from_string( $hold->reservedate )->add( years => 2 )->ymd; |
| 241 |
is( $hold->expirationdate, |
| 242 |
$expected_date, 'Expiration date set after reverting holds waiting status.' ); |
| 243 |
|
| 225 |
$schema->storage->txn_rollback(); |
244 |
$schema->storage->txn_rollback(); |
| 226 |
}; |
245 |
}; |
| 227 |
|
246 |
|
| 228 |
- |
|
|