View | Details | Raw Unified | Return to bug 24083
Collapse All | Expand All

(-)a/t/db_dependent/Circulation.t (+8 lines)
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');
(-)a/t/db_dependent/Circulation/issue.t (-1 / +15 lines)
Lines 32-37 use Koha::Checkouts; Link Here
32
use Koha::Database;
32
use Koha::Database;
33
use Koha::DateUtils;
33
use Koha::DateUtils;
34
use Koha::Holds;
34
use Koha::Holds;
35
use Koha::IssuingRules;
35
use Koha::Items;
36
use Koha::Items;
36
use Koha::Library;
37
use Koha::Library;
37
use Koha::Patrons;
38
use Koha::Patrons;
Lines 297-302 subtest 'Show that AddRenewal respects OpacRenewalBranch and interface' => sub { Link Here
297
    }
298
    }
298
};
299
};
299
300
301
# Unseen rewnewals
302
t::lib::Mocks::mock_preference('UnseenRenewals', 1);
303
304
# Does an unseen renewal increment the issue's count
305
my ( $unseen_before ) = ( C4::Circulation::GetRenewCount( $opac_renew_issue->{borrowernumber}, $opac_renew_issue->{itemnumber} ) )[3];
306
AddRenewal( $opac_renew_issue->{borrowernumber}, $opac_renew_issue->{itemnumber}, $branchcode_1, undef, undef, 0 );
307
my ( $unseen_after ) = ( C4::Circulation::GetRenewCount( $opac_renew_issue->{borrowernumber}, $opac_renew_issue->{itemnumber} ) )[3];
308
is( $unseen_after, $unseen_before + 1, 'unseen_renewals increments' );
309
310
# Does a seen renewal reset the unseen count
311
AddRenewal( $opac_renew_issue->{borrowernumber}, $opac_renew_issue->{itemnumber}, $branchcode_1, undef, undef, 1 );
312
my ( $unseen_reset ) = ( C4::Circulation::GetRenewCount( $opac_renew_issue->{borrowernumber}, $opac_renew_issue->{itemnumber} ) )[3];
313
is( $unseen_reset, 0, 'seen renewal resets the unseen count' );
314
300
#Test GetBiblioIssues
315
#Test GetBiblioIssues
301
is( GetBiblioIssues(), undef, "GetBiblio Issues without parameters" );
316
is( GetBiblioIssues(), undef, "GetBiblio Issues without parameters" );
302
317
303
- 

Return to bug 24083