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 => 85; |
282 |
|
282 |
|
283 |
C4::Context->set_preference('ItemsDeniedRenewal',''); |
283 |
C4::Context->set_preference('ItemsDeniedRenewal',''); |
284 |
# Generate test biblio |
284 |
# Generate test biblio |
Lines 1151-1156
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
1151 |
is( $renewokay, 0, 'Cannot renew, 0 renewals allowed'); |
1151 |
is( $renewokay, 0, 'Cannot renew, 0 renewals allowed'); |
1152 |
is( $error, 'too_many', 'Cannot renew, 0 renewals allowed (returned code is too_many)'); |
1152 |
is( $error, 'too_many', 'Cannot renew, 0 renewals allowed (returned code is too_many)'); |
1153 |
|
1153 |
|
|
|
1154 |
# Too many unseen renewals |
1155 |
$dbh->do('UPDATE issuingrules SET unseen_renewals_allowed = 2, renewalsallowed = 10'); |
1156 |
$dbh->do('UPDATE issues SET unseen_renewals = 2 where borrowernumber = ? AND itemnumber = ?', undef, ($renewing_borrowernumber, $item_1->itemnumber)); |
1157 |
( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $item_1->itemnumber); |
1158 |
is( $renewokay, 0, 'Cannot renew, 0 unseen renewals allowed'); |
1159 |
is( $error, 'too_unseen', 'Cannot renew, returned code is too_unseen'); |
1160 |
$dbh->do('UPDATE issuingrules SET norenewalbefore = NULL, renewalsallowed = 0'); |
1161 |
|
1154 |
# Test WhenLostForgiveFine and WhenLostChargeReplacementFee |
1162 |
# Test WhenLostForgiveFine and WhenLostChargeReplacementFee |
1155 |
t::lib::Mocks::mock_preference('WhenLostForgiveFine','1'); |
1163 |
t::lib::Mocks::mock_preference('WhenLostForgiveFine','1'); |
1156 |
t::lib::Mocks::mock_preference('WhenLostChargeReplacementFee','1'); |
1164 |
t::lib::Mocks::mock_preference('WhenLostChargeReplacementFee','1'); |