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

(-)a/t/db_dependent/Circulation.t (-5 / +15 lines)
Lines 27-33 use C4::Overdues qw(UpdateFine); Link Here
27
use Koha::DateUtils;
27
use Koha::DateUtils;
28
use Koha::Database;
28
use Koha::Database;
29
29
30
use Test::More tests => 65;
30
use Test::More tests => 67;
31
31
32
BEGIN {
32
BEGIN {
33
    use_ok('C4::Circulation');
33
    use_ok('C4::Circulation');
Lines 658-671 C4::Context->dbh->do("DELETE FROM accountlines"); Link Here
658
        undef, undef, undef
658
        undef, undef, undef
659
    );
659
    );
660
660
661
    C4::Context->dbh->do("UPDATE issuingrules SET onshelfholds = 0");
662
    C4::Context->set_preference( 'AllowRenewalIfOtherItemsAvailable', 0 );
661
    ( $renewokay, $error ) = CanBookBeRenewed( $borrowernumber1, $itemnumber1 );
663
    ( $renewokay, $error ) = CanBookBeRenewed( $borrowernumber1, $itemnumber1 );
662
    is( $renewokay, 0, 'Bug 14337 - Verify the borrower cannot renew with a hold on the record' );
664
    is( $renewokay, 0, 'Bug 14337 - Verify the borrower cannot renew with a hold on the record if AllowRenewalIfOtherItemsAvailable and onshelfholds are disabled' );
663
665
664
    C4::Context->dbh->do("UPDATE issuingrules SET onshelfholds = 1");
666
    C4::Context->dbh->do("UPDATE issuingrules SET onshelfholds = 0");
665
    C4::Context->set_preference( 'AllowRenewalIfOtherItemsAvailable', 1 );
667
    C4::Context->set_preference( 'AllowRenewalIfOtherItemsAvailable', 1 );
668
    ( $renewokay, $error ) = CanBookBeRenewed( $borrowernumber1, $itemnumber1 );
669
    is( $renewokay, 0, 'Bug 14337 - Verify the borrower cannot renew with a hold on the record if AllowRenewalIfOtherItemsAvailable is enabled and onshelfholds is disabled' );
666
670
671
    C4::Context->dbh->do("UPDATE issuingrules SET onshelfholds = 1");
672
    C4::Context->set_preference( 'AllowRenewalIfOtherItemsAvailable', 0 );
673
    ( $renewokay, $error ) = CanBookBeRenewed( $borrowernumber1, $itemnumber1 );
674
    is( $renewokay, 0, 'Bug 14337 - Verify the borrower cannot renew with a hold on the record if AllowRenewalIfOtherItemsAvailable is disabled and onshelfhold is enabled' );
675
676
    C4::Context->dbh->do("UPDATE issuingrules SET onshelfholds = 1");
677
    C4::Context->set_preference( 'AllowRenewalIfOtherItemsAvailable', 1 );
667
    ( $renewokay, $error ) = CanBookBeRenewed( $borrowernumber1, $itemnumber1 );
678
    ( $renewokay, $error ) = CanBookBeRenewed( $borrowernumber1, $itemnumber1 );
668
    is( $renewokay, 1, 'Bug 14337 - Verify the borrower can renew with a hold on the record if AllowRenewalIfOtherItemsAvailable is enabled' );
679
    is( $renewokay, 1, 'Bug 14337 - Verify the borrower can renew with a hold on the record if AllowRenewalIfOtherItemsAvailable and onshelfhold are enabled' );
669
680
670
    # Setting item not checked out to be not for loan but holdable
681
    # Setting item not checked out to be not for loan but holdable
671
    ModItem({ notforloan => -1 }, $biblionumber, $itemnumber2);
682
    ModItem({ notforloan => -1 }, $biblionumber, $itemnumber2);
672
- 

Return to bug 14337