Lines 7-13
use t::lib::TestBuilder;
Link Here
|
7 |
|
7 |
|
8 |
use C4::Context; |
8 |
use C4::Context; |
9 |
|
9 |
|
10 |
use Test::More tests => 61; |
10 |
use Test::More tests => 62; |
11 |
use MARC::Record; |
11 |
use MARC::Record; |
12 |
use C4::Biblio; |
12 |
use C4::Biblio; |
13 |
use C4::Items; |
13 |
use C4::Items; |
Lines 34-40
my $dbh = C4::Context->dbh;
Link Here
|
34 |
my $branch_1 = $builder->build({ source => 'Branch' })->{ branchcode }; |
34 |
my $branch_1 = $builder->build({ source => 'Branch' })->{ branchcode }; |
35 |
my $branch_2 = $builder->build({ source => 'Branch' })->{ branchcode }; |
35 |
my $branch_2 = $builder->build({ source => 'Branch' })->{ branchcode }; |
36 |
|
36 |
|
37 |
my $category = $builder->build({ source => 'Category' }); |
37 |
my $category = $builder->build({ |
|
|
38 |
source => 'Category', |
39 |
value => { |
40 |
BlockExpiredPatronOpacActions => -1, |
41 |
}, |
42 |
}); |
38 |
|
43 |
|
39 |
my $borrowers_count = 5; |
44 |
my $borrowers_count = 5; |
40 |
|
45 |
|
Lines 486-491
my $res_id = AddReserve( $branch_1, $borrowernumbers[0], $bibnum, '', 1, );
Link Here
|
486 |
is( CanItemBeReserved( $borrowernumbers[0], $itemnumber ), |
491 |
is( CanItemBeReserved( $borrowernumbers[0], $itemnumber ), |
487 |
'tooManyReserves', 'Patron cannot reserve item with hold limit of 1, 1 bib level hold placed' ); |
492 |
'tooManyReserves', 'Patron cannot reserve item with hold limit of 1, 1 bib level hold placed' ); |
488 |
|
493 |
|
|
|
494 |
my $expired_borrowernumber = AddMember( |
495 |
firstname => 'Expired', |
496 |
surname => 'Patron', |
497 |
categorycode => $category->{categorycode}, |
498 |
branchcode => $branch_1, |
499 |
dateexpiry => '2000-01-01', |
500 |
); |
501 |
t::lib::Mocks::mock_preference('BlockExpiredPatronOpacActions', 1); |
502 |
is(CanItemBeReserved($expired_borrowernumber, $itemnumber), |
503 |
'expired', 'Expired patron cannot reserve'); |
504 |
|
489 |
|
505 |
|
490 |
# Helper method to set up a Biblio. |
506 |
# Helper method to set up a Biblio. |
491 |
sub create_helper_biblio { |
507 |
sub create_helper_biblio { |
492 |
- |
|
|