Lines 1370-1377
subtest 'ReserveExpiration syspref tests' => sub {
Link Here
|
1370 |
t::lib::Mocks::mock_preference( 'ReserveExpiration', 1 ); |
1370 |
t::lib::Mocks::mock_preference( 'ReserveExpiration', 1 ); |
1371 |
|
1371 |
|
1372 |
my $expirationdate = dt_from_string->add( days => 1 ); |
1372 |
my $expirationdate = dt_from_string->add( days => 1 ); |
1373 |
my $hold = $builder->build_object( |
1373 |
my $hold = $builder->build_object( |
1374 |
{ class => 'Koha::Holds', |
1374 |
{ |
|
|
1375 |
class => 'Koha::Holds', |
1375 |
value => { expirationdate => $expirationdate } |
1376 |
value => { expirationdate => $expirationdate } |
1376 |
} |
1377 |
} |
1377 |
); |
1378 |
); |
Lines 1379-1385
subtest 'ReserveExpiration syspref tests' => sub {
Link Here
|
1379 |
# Disable expiration date for reserves |
1380 |
# Disable expiration date for reserves |
1380 |
t::lib::Mocks::mock_preference( 'ReserveExpiration', 0 ); |
1381 |
t::lib::Mocks::mock_preference( 'ReserveExpiration', 0 ); |
1381 |
|
1382 |
|
1382 |
my $reverted = C4::Reserves::RevertWaitingStatus({ itemnumber => $hold->itemnumber }); |
1383 |
my $reverted = C4::Reserves::RevertWaitingStatus( { itemnumber => $hold->itemnumber } ); |
1383 |
|
1384 |
|
1384 |
is( $reverted->expirationdate, undef, "Expiration date should be removed with reserve expiration disabled" ); |
1385 |
is( $reverted->expirationdate, undef, "Expiration date should be removed with reserve expiration disabled" ); |
1385 |
|
1386 |
|
Lines 1387-1400
subtest 'ReserveExpiration syspref tests' => sub {
Link Here
|
1387 |
t::lib::Mocks::mock_preference( 'ReserveExpiration', 1 ); |
1388 |
t::lib::Mocks::mock_preference( 'ReserveExpiration', 1 ); |
1388 |
|
1389 |
|
1389 |
$hold = $builder->build_object( |
1390 |
$hold = $builder->build_object( |
1390 |
{ class => 'Koha::Holds', |
1391 |
{ |
|
|
1392 |
class => 'Koha::Holds', |
1391 |
value => { expirationdate => $expirationdate } |
1393 |
value => { expirationdate => $expirationdate } |
1392 |
} |
1394 |
} |
1393 |
); |
1395 |
); |
1394 |
|
1396 |
|
1395 |
$reverted = C4::Reserves::RevertWaitingStatus({ itemnumber => $hold->itemnumber }); |
1397 |
$reverted = C4::Reserves::RevertWaitingStatus( { itemnumber => $hold->itemnumber } ); |
1396 |
|
1398 |
|
1397 |
is( $reverted->expirationdate, undef, "Expiration date is still removed because we can't reset to the original expiration date" ); |
1399 |
is( |
|
|
1400 |
$reverted->expirationdate, undef, |
1401 |
"Expiration date is still removed because we can't reset to the original expiration date" |
1402 |
); |
1398 |
}; |
1403 |
}; |
1399 |
|
1404 |
|
1400 |
sub count_hold_print_messages { |
1405 |
sub count_hold_print_messages { |
1401 |
- |
|
|