|
Lines 277-283
$dbh->do(
Link Here
|
| 277 |
|
277 |
|
| 278 |
my ( $reused_itemnumber_1, $reused_itemnumber_2 ); |
278 |
my ( $reused_itemnumber_1, $reused_itemnumber_2 ); |
| 279 |
subtest "CanBookBeRenewed tests" => sub { |
279 |
subtest "CanBookBeRenewed tests" => sub { |
| 280 |
plan tests => 71; |
280 |
plan tests => 73; |
| 281 |
|
281 |
|
| 282 |
C4::Context->set_preference('ItemsDeniedRenewal',''); |
282 |
C4::Context->set_preference('ItemsDeniedRenewal',''); |
| 283 |
# Generate test biblio |
283 |
# Generate test biblio |
|
Lines 916-921
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
| 916 |
is( $renewokay, 0, 'Cannot renew, 0 renewals allowed'); |
916 |
is( $renewokay, 0, 'Cannot renew, 0 renewals allowed'); |
| 917 |
is( $error, 'too_many', 'Cannot renew, 0 renewals allowed (returned code is too_many)'); |
917 |
is( $error, 'too_many', 'Cannot renew, 0 renewals allowed (returned code is too_many)'); |
| 918 |
|
918 |
|
|
|
919 |
# Too many unseen renewals |
| 920 |
$dbh->do('UPDATE issuingrules SET unseen_renewals_allowed = 2, renewalsallowed = 10'); |
| 921 |
$dbh->do('UPDATE issues SET unseen_renewals = 2 where borrowernumber = ? AND itemnumber = ?', undef, ($renewing_borrowernumber, $item_1->itemnumber)); |
| 922 |
( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $item_1->itemnumber); |
| 923 |
is( $renewokay, 0, 'Cannot renew, 0 unseen renewals allowed'); |
| 924 |
is( $error, 'too_unseen', 'Cannot renew, returned code is too_unseen'); |
| 925 |
$dbh->do('UPDATE issuingrules SET norenewalbefore = NULL, renewalsallowed = 0'); |
| 926 |
|
| 919 |
# Test WhenLostForgiveFine and WhenLostChargeReplacementFee |
927 |
# Test WhenLostForgiveFine and WhenLostChargeReplacementFee |
| 920 |
t::lib::Mocks::mock_preference('WhenLostForgiveFine','1'); |
928 |
t::lib::Mocks::mock_preference('WhenLostForgiveFine','1'); |
| 921 |
t::lib::Mocks::mock_preference('WhenLostChargeReplacementFee','1'); |
929 |
t::lib::Mocks::mock_preference('WhenLostChargeReplacementFee','1'); |