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 => 55; |
10 |
use Test::More tests => 56; |
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 35-41
my $dbh = C4::Context->dbh;
Link Here
|
35 |
my $branch_1 = $builder->build({ source => 'Branch' })->{ branchcode }; |
35 |
my $branch_1 = $builder->build({ source => 'Branch' })->{ branchcode }; |
36 |
my $branch_2 = $builder->build({ source => 'Branch' })->{ branchcode }; |
36 |
my $branch_2 = $builder->build({ source => 'Branch' })->{ branchcode }; |
37 |
|
37 |
|
38 |
my $category = $builder->build({ source => 'Category' }); |
38 |
my $category = $builder->build({ |
|
|
39 |
source => 'Category', |
40 |
value => { |
41 |
BlockExpiredPatronOpacActions => -1, |
42 |
}, |
43 |
}); |
39 |
|
44 |
|
40 |
my $borrowers_count = 5; |
45 |
my $borrowers_count = 5; |
41 |
|
46 |
|
Lines 411-416
my $res_id = AddReserve( $branch_1, $borrowernumbers[0], $bibnum, '', 1, );
Link Here
|
411 |
is( CanItemBeReserved( $borrowernumbers[0], $itemnumber ), |
416 |
is( CanItemBeReserved( $borrowernumbers[0], $itemnumber ), |
412 |
'tooManyReserves', 'Patron cannot reserve item with hold limit of 1, 1 bib level hold placed' ); |
417 |
'tooManyReserves', 'Patron cannot reserve item with hold limit of 1, 1 bib level hold placed' ); |
413 |
|
418 |
|
|
|
419 |
my $expired_borrowernumber = AddMember( |
420 |
firstname => 'Expired', |
421 |
surname => 'Patron', |
422 |
categorycode => $category->{categorycode}, |
423 |
branchcode => $branch_1, |
424 |
dateexpiry => '2000-01-01', |
425 |
); |
426 |
t::lib::Mocks::mock_preference('BlockExpiredPatronOpacActions', 1); |
427 |
is(CanItemBeReserved($expired_borrowernumber, $itemnumber), |
428 |
'expired', 'Expired patron cannot reserve'); |
429 |
|
414 |
|
430 |
|
415 |
# Helper method to set up a Biblio. |
431 |
# Helper method to set up a Biblio. |
416 |
sub create_helper_biblio { |
432 |
sub create_helper_biblio { |
417 |
- |
|
|