Lines 274-280
Koha::CirculationRules->set_rules(
Link Here
|
274 |
|
274 |
|
275 |
my ( $reused_itemnumber_1, $reused_itemnumber_2 ); |
275 |
my ( $reused_itemnumber_1, $reused_itemnumber_2 ); |
276 |
subtest "CanBookBeRenewed tests" => sub { |
276 |
subtest "CanBookBeRenewed tests" => sub { |
277 |
plan tests => 71; |
277 |
plan tests => 73; |
278 |
|
278 |
|
279 |
C4::Context->set_preference('ItemsDeniedRenewal',''); |
279 |
C4::Context->set_preference('ItemsDeniedRenewal',''); |
280 |
# Generate test biblio |
280 |
# Generate test biblio |
Lines 1089-1094
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
1089 |
is( $renewokay, 0, 'Cannot renew, 0 renewals allowed'); |
1089 |
is( $renewokay, 0, 'Cannot renew, 0 renewals allowed'); |
1090 |
is( $error, 'too_many', 'Cannot renew, 0 renewals allowed (returned code is too_many)'); |
1090 |
is( $error, 'too_many', 'Cannot renew, 0 renewals allowed (returned code is too_many)'); |
1091 |
|
1091 |
|
|
|
1092 |
# Too many unseen renewals |
1093 |
$dbh->do('UPDATE issuingrules SET unseen_renewals_allowed = 2, renewalsallowed = 10'); |
1094 |
$dbh->do('UPDATE issues SET unseen_renewals = 2 where borrowernumber = ? AND itemnumber = ?', undef, ($renewing_borrowernumber, $item_1->itemnumber)); |
1095 |
( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $item_1->itemnumber); |
1096 |
is( $renewokay, 0, 'Cannot renew, 0 unseen renewals allowed'); |
1097 |
is( $error, 'too_unseen', 'Cannot renew, returned code is too_unseen'); |
1098 |
$dbh->do('UPDATE issuingrules SET norenewalbefore = NULL, renewalsallowed = 0'); |
1099 |
|
1092 |
# Test WhenLostForgiveFine and WhenLostChargeReplacementFee |
1100 |
# Test WhenLostForgiveFine and WhenLostChargeReplacementFee |
1093 |
t::lib::Mocks::mock_preference('WhenLostForgiveFine','1'); |
1101 |
t::lib::Mocks::mock_preference('WhenLostForgiveFine','1'); |
1094 |
t::lib::Mocks::mock_preference('WhenLostChargeReplacementFee','1'); |
1102 |
t::lib::Mocks::mock_preference('WhenLostChargeReplacementFee','1'); |