Lines 657-666
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
657 |
|
657 |
|
658 |
|
658 |
|
659 |
|
659 |
|
660 |
$renewing_borrower_obj->autorenewal(0)->store; |
660 |
$renewing_borrower_obj->autorenew_checkouts(0)->store; |
661 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
661 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
662 |
is( $renewokay, 1, 'No renewal before is undef, but patron opted out of auto_renewal' ); |
662 |
is( $renewokay, 1, 'No renewal before is undef, but patron opted out of auto_renewal' ); |
663 |
$renewing_borrower_obj->autorenewal(1)->store; |
663 |
$renewing_borrower_obj->autorenew_checkouts(1)->store; |
664 |
|
664 |
|
665 |
|
665 |
|
666 |
# Bug 7413 |
666 |
# Bug 7413 |
Lines 706-716
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
706 |
'Bug 14101: Cannot renew, renewal is automatic and premature (returned code is auto_too_soon)' |
706 |
'Bug 14101: Cannot renew, renewal is automatic and premature (returned code is auto_too_soon)' |
707 |
); |
707 |
); |
708 |
|
708 |
|
709 |
$renewing_borrower_obj->autorenewal(0)->store; |
709 |
$renewing_borrower_obj->autorenew_checkouts(0)->store; |
710 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
710 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
711 |
is( $renewokay, 0, 'No renewal before is 7, patron opted out of auto_renewal still cannot renew early' ); |
711 |
is( $renewokay, 0, 'No renewal before is 7, patron opted out of auto_renewal still cannot renew early' ); |
712 |
is( $error, 'too_soon', 'Error is too_soon, no auto' ); |
712 |
is( $error, 'too_soon', 'Error is too_soon, no auto' ); |
713 |
$renewing_borrower_obj->autorenewal(1)->store; |
713 |
$renewing_borrower_obj->autorenew_checkouts(1)->store; |
714 |
|
714 |
|
715 |
# Change policy so that loans can only be renewed exactly on due date (0 days prior to due date) |
715 |
# Change policy so that loans can only be renewed exactly on due date (0 days prior to due date) |
716 |
# and test automatic renewal again |
716 |
# and test automatic renewal again |
Lines 722-732
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
722 |
'Bug 14101: Cannot renew, renewal is automatic and premature, "No renewal before" = 0 (returned code is auto_too_soon)' |
722 |
'Bug 14101: Cannot renew, renewal is automatic and premature, "No renewal before" = 0 (returned code is auto_too_soon)' |
723 |
); |
723 |
); |
724 |
|
724 |
|
725 |
$renewing_borrower_obj->autorenewal(0)->store; |
725 |
$renewing_borrower_obj->autorenew_checkouts(0)->store; |
726 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
726 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
727 |
is( $renewokay, 0, 'No renewal before is 0, patron opted out of auto_renewal still cannot renew early' ); |
727 |
is( $renewokay, 0, 'No renewal before is 0, patron opted out of auto_renewal still cannot renew early' ); |
728 |
is( $error, 'too_soon', 'Error is too_soon, no auto' ); |
728 |
is( $error, 'too_soon', 'Error is too_soon, no auto' ); |
729 |
$renewing_borrower_obj->autorenewal(1)->store; |
729 |
$renewing_borrower_obj->autorenew_checkouts(1)->store; |
730 |
|
730 |
|
731 |
# Change policy so that loans can be renewed 99 days prior to the due date |
731 |
# Change policy so that loans can be renewed 99 days prior to the due date |
732 |
# and test automatic renewal again |
732 |
# and test automatic renewal again |
Lines 738-747
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
738 |
'Bug 14101: Cannot renew, renewal is automatic (returned code is auto_renew)' |
738 |
'Bug 14101: Cannot renew, renewal is automatic (returned code is auto_renew)' |
739 |
); |
739 |
); |
740 |
|
740 |
|
741 |
$renewing_borrower_obj->autorenewal(0)->store; |
741 |
$renewing_borrower_obj->autorenew_checkouts(0)->store; |
742 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
742 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
743 |
is( $renewokay, 1, 'No renewal before is 99, patron opted out of auto_renewal so can renew' ); |
743 |
is( $renewokay, 1, 'No renewal before is 99, patron opted out of auto_renewal so can renew' ); |
744 |
$renewing_borrower_obj->autorenewal(1)->store; |
744 |
$renewing_borrower_obj->autorenew_checkouts(1)->store; |
745 |
|
745 |
|
746 |
subtest "too_late_renewal / no_auto_renewal_after" => sub { |
746 |
subtest "too_late_renewal / no_auto_renewal_after" => sub { |
747 |
plan tests => 14; |
747 |
plan tests => 14; |
748 |
- |
|
|