Lines 1157-1162
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
1157 |
is( $renewokay, 0, 'Cannot renew, 0 renewals allowed'); |
1157 |
is( $renewokay, 0, 'Cannot renew, 0 renewals allowed'); |
1158 |
is( $error, 'too_many', 'Cannot renew, 0 renewals allowed (returned code is too_many)'); |
1158 |
is( $error, 'too_many', 'Cannot renew, 0 renewals allowed (returned code is too_many)'); |
1159 |
|
1159 |
|
|
|
1160 |
# Too many unseen renewals |
1161 |
$dbh->do('UPDATE issuingrules SET unseen_renewals_allowed = 2, renewalsallowed = 10'); |
1162 |
$dbh->do('UPDATE issues SET unseen_renewals = 2 where borrowernumber = ? AND itemnumber = ?', undef, ($renewing_borrowernumber, $item_1->itemnumber)); |
1163 |
( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $item_1->itemnumber); |
1164 |
is( $renewokay, 0, 'Cannot renew, 0 unseen renewals allowed'); |
1165 |
is( $error, 'too_unseen', 'Cannot renew, returned code is too_unseen'); |
1166 |
$dbh->do('UPDATE issuingrules SET norenewalbefore = NULL, renewalsallowed = 0'); |
1167 |
|
1160 |
# Test WhenLostForgiveFine and WhenLostChargeReplacementFee |
1168 |
# Test WhenLostForgiveFine and WhenLostChargeReplacementFee |
1161 |
t::lib::Mocks::mock_preference('WhenLostForgiveFine','1'); |
1169 |
t::lib::Mocks::mock_preference('WhenLostForgiveFine','1'); |
1162 |
t::lib::Mocks::mock_preference('WhenLostChargeReplacementFee','1'); |
1170 |
t::lib::Mocks::mock_preference('WhenLostChargeReplacementFee','1'); |