Lines 279-285
$dbh->do(
Link Here
|
279 |
|
279 |
|
280 |
my ( $reused_itemnumber_1, $reused_itemnumber_2 ); |
280 |
my ( $reused_itemnumber_1, $reused_itemnumber_2 ); |
281 |
subtest "CanBookBeRenewed tests" => sub { |
281 |
subtest "CanBookBeRenewed tests" => sub { |
282 |
plan tests => 77; |
282 |
plan tests => 81; |
283 |
|
283 |
|
284 |
C4::Context->set_preference('ItemsDeniedRenewal',''); |
284 |
C4::Context->set_preference('ItemsDeniedRenewal',''); |
285 |
# Generate test biblio |
285 |
# Generate test biblio |
Lines 615-624
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
615 |
); |
615 |
); |
616 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
616 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
617 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
617 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
618 |
is( $error, 'auto_too_soon', 'returned code is auto_too_soon, reserve not checked' ); |
618 |
is( $error, 'on_reserve', 'returned code is on_reserve, reserve checked when not checking for cron' ); |
|
|
619 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber, undef, 1 ); |
620 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
621 |
is( $error, 'auto_too_soon', 'returned code is auto_too_soon, reserve not checked when checking for cron' ); |
619 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber, 1 ); |
622 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber, 1 ); |
620 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
623 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
621 |
is( $error, 'on_reserve', 'returned code is on_reserve, auto_too_soon limit is overridden' ); |
624 |
is( $error, 'on_reserve', 'returned code is on_reserve, auto_too_soon limit is overridden' ); |
|
|
625 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber, 1, 1 ); |
626 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
627 |
is( $error, 'on_reserve', 'returned code is on_reserve, auto_too_soon limit is overridden' ); |
622 |
$dbh->do('UPDATE circulation_rules SET rule_value = 0 where rule_name = "norenewalbefore"'); |
628 |
$dbh->do('UPDATE circulation_rules SET rule_value = 0 where rule_name = "norenewalbefore"'); |
623 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber, 1 ); |
629 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber, 1 ); |
624 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
630 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
625 |
- |
|
|