Lines 278-284
Koha::CirculationRules->set_rules(
Link Here
|
278 |
|
278 |
|
279 |
my ( $reused_itemnumber_1, $reused_itemnumber_2 ); |
279 |
my ( $reused_itemnumber_1, $reused_itemnumber_2 ); |
280 |
subtest "CanBookBeRenewed tests" => sub { |
280 |
subtest "CanBookBeRenewed tests" => sub { |
281 |
plan tests => 83; |
281 |
plan tests => 87; |
282 |
|
282 |
|
283 |
C4::Context->set_preference('ItemsDeniedRenewal',''); |
283 |
C4::Context->set_preference('ItemsDeniedRenewal',''); |
284 |
# Generate test biblio |
284 |
# Generate test biblio |
Lines 649-658
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
649 |
); |
649 |
); |
650 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
650 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
651 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
651 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
652 |
is( $error, 'auto_too_soon', 'returned code is auto_too_soon, reserve not checked' ); |
652 |
is( $error, 'on_reserve', 'returned code is on_reserve, reserve checked when not checking for cron' ); |
|
|
653 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber, undef, 1 ); |
654 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
655 |
is( $error, 'auto_too_soon', 'returned code is auto_too_soon, reserve not checked when checking for cron' ); |
653 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber, 1 ); |
656 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber, 1 ); |
654 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
657 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
655 |
is( $error, 'on_reserve', 'returned code is on_reserve, auto_too_soon limit is overridden' ); |
658 |
is( $error, 'on_reserve', 'returned code is on_reserve, auto_too_soon limit is overridden' ); |
|
|
659 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber, 1, 1 ); |
660 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
661 |
is( $error, 'on_reserve', 'returned code is on_reserve, auto_too_soon limit is overridden' ); |
656 |
$dbh->do('UPDATE circulation_rules SET rule_value = 0 where rule_name = "norenewalbefore"'); |
662 |
$dbh->do('UPDATE circulation_rules SET rule_value = 0 where rule_name = "norenewalbefore"'); |
657 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber, 1 ); |
663 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber, 1 ); |
658 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
664 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
659 |
- |
|
|