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