@@ -, +, @@ check --- t/db_dependent/Holds.t | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) --- a/t/db_dependent/Holds.t +++ a/t/db_dependent/Holds.t @@ -7,7 +7,7 @@ use t::lib::TestBuilder; use C4::Context; -use Test::More tests => 57; +use Test::More tests => 58; use MARC::Record; use C4::Biblio; @@ -41,7 +41,12 @@ my $dbh = C4::Context->dbh; my $branch_1 = $builder->build({ source => 'Branch' })->{ branchcode }; my $branch_2 = $builder->build({ source => 'Branch' })->{ branchcode }; -my $category = $builder->build({ source => 'Category' }); +my $category = $builder->build({ + source => 'Category', + value => { + BlockExpiredPatronOpacActions => -1, + }, +}); my $borrowers_count = 5; @@ -413,6 +418,7 @@ my $res_id = AddReserve( $branch_1, $borrowernumbers[0], $biblio->biblionumber, is( CanItemBeReserved( $borrowernumbers[0], $itemnumber )->{status}, 'tooManyReserves', 'Patron cannot reserve item with hold limit of 1, 1 bib level hold placed' ); +<<<<<<< HEAD subtest 'Test max_holds per library/patron category' => sub { plan tests => 6; @@ -452,6 +458,19 @@ subtest 'Test max_holds per library/patron category' => sub { rule_value => 3, } ); +======= +my $expired_borrowernumber = AddMember( + firstname => 'Expired', + surname => 'Patron', + categorycode => $category->{categorycode}, + branchcode => $branch_1, + dateexpiry => '2000-01-01', +); +t::lib::Mocks::mock_preference('BlockExpiredPatronOpacActions', 1); +is(CanItemBeReserved($expired_borrowernumber, $itemnumber), + 'expired', 'Expired patron cannot reserve'); + +>>>>>>> Bug 17229: Add unit test for BlockExpiredPatronOpacActions check my $rule_branch = Koha::CirculationRules->set_rule( { --