Lines 1426-1433
subtest 'ReserveExpiration syspref tests' => sub {
Link Here
|
1426 |
t::lib::Mocks::mock_preference( 'ReserveExpiration', 1 ); |
1426 |
t::lib::Mocks::mock_preference( 'ReserveExpiration', 1 ); |
1427 |
|
1427 |
|
1428 |
my $expirationdate = dt_from_string->add( days => 1 ); |
1428 |
my $expirationdate = dt_from_string->add( days => 1 ); |
1429 |
my $hold = $builder->build_object( |
1429 |
my $hold = $builder->build_object( |
1430 |
{ class => 'Koha::Holds', |
1430 |
{ |
|
|
1431 |
class => 'Koha::Holds', |
1431 |
value => { expirationdate => $expirationdate } |
1432 |
value => { expirationdate => $expirationdate } |
1432 |
} |
1433 |
} |
1433 |
); |
1434 |
); |
Lines 1435-1441
subtest 'ReserveExpiration syspref tests' => sub {
Link Here
|
1435 |
# Disable expiration date for reserves |
1436 |
# Disable expiration date for reserves |
1436 |
t::lib::Mocks::mock_preference( 'ReserveExpiration', 0 ); |
1437 |
t::lib::Mocks::mock_preference( 'ReserveExpiration', 0 ); |
1437 |
|
1438 |
|
1438 |
my $reverted = C4::Reserves::RevertWaitingStatus({ itemnumber => $hold->itemnumber }); |
1439 |
my $reverted = C4::Reserves::RevertWaitingStatus( { itemnumber => $hold->itemnumber } ); |
1439 |
|
1440 |
|
1440 |
is( $reverted->expirationdate, undef, "Expiration date should be removed with reserve expiration disabled" ); |
1441 |
is( $reverted->expirationdate, undef, "Expiration date should be removed with reserve expiration disabled" ); |
1441 |
|
1442 |
|
Lines 1443-1456
subtest 'ReserveExpiration syspref tests' => sub {
Link Here
|
1443 |
t::lib::Mocks::mock_preference( 'ReserveExpiration', 1 ); |
1444 |
t::lib::Mocks::mock_preference( 'ReserveExpiration', 1 ); |
1444 |
|
1445 |
|
1445 |
$hold = $builder->build_object( |
1446 |
$hold = $builder->build_object( |
1446 |
{ class => 'Koha::Holds', |
1447 |
{ |
|
|
1448 |
class => 'Koha::Holds', |
1447 |
value => { expirationdate => $expirationdate } |
1449 |
value => { expirationdate => $expirationdate } |
1448 |
} |
1450 |
} |
1449 |
); |
1451 |
); |
1450 |
|
1452 |
|
1451 |
$reverted = C4::Reserves::RevertWaitingStatus({ itemnumber => $hold->itemnumber }); |
1453 |
$reverted = C4::Reserves::RevertWaitingStatus( { itemnumber => $hold->itemnumber } ); |
1452 |
|
1454 |
|
1453 |
is( $reverted->expirationdate, undef, "Expiration date is still removed because we can't reset to the original expiration date" ); |
1455 |
is( |
|
|
1456 |
$reverted->expirationdate, undef, |
1457 |
"Expiration date is still removed because we can't reset to the original expiration date" |
1458 |
); |
1454 |
}; |
1459 |
}; |
1455 |
|
1460 |
|
1456 |
sub count_hold_print_messages { |
1461 |
sub count_hold_print_messages { |
1457 |
- |
|
|