|
Lines 43-49
my $dbh = C4::Context->dbh;
Link Here
|
| 43 |
my $branch_1 = $builder->build({ source => 'Branch' })->{ branchcode }; |
43 |
my $branch_1 = $builder->build({ source => 'Branch' })->{ branchcode }; |
| 44 |
my $branch_2 = $builder->build({ source => 'Branch' })->{ branchcode }; |
44 |
my $branch_2 = $builder->build({ source => 'Branch' })->{ branchcode }; |
| 45 |
|
45 |
|
| 46 |
my $category = $builder->build({ source => 'Category' }); |
46 |
my $category = $builder->build({ |
|
|
47 |
source => 'Category', |
| 48 |
value => { |
| 49 |
BlockExpiredPatronOpacActions => -1, |
| 50 |
}, |
| 51 |
}); |
| 47 |
|
52 |
|
| 48 |
my $borrowers_count = 5; |
53 |
my $borrowers_count = 5; |
| 49 |
|
54 |
|
|
Lines 127-132
my $patron = Koha::Patrons->find( $borrowernumbers[0] );
Link Here
|
| 127 |
$holds = $patron->holds; |
132 |
$holds = $patron->holds; |
| 128 |
is( $holds->next->borrowernumber, $borrowernumbers[0], "Test Koha::Patron->holds"); |
133 |
is( $holds->next->borrowernumber, $borrowernumbers[0], "Test Koha::Patron->holds"); |
| 129 |
|
134 |
|
|
|
135 |
my $expired_borrowernumber = Koha::Patron->new({ |
| 136 |
firstname => 'Expired', |
| 137 |
surname => 'Patron', |
| 138 |
categorycode => $category->{categorycode}, |
| 139 |
branchcode => $branch_1, |
| 140 |
dateexpiry => '2000-01-01', |
| 141 |
})->store->borrowernumber; |
| 142 |
|
| 143 |
t::lib::Mocks::mock_preference('BlockExpiredPatronOpacActions', 1); |
| 144 |
ok( |
| 145 |
CanItemBeReserved($expired_borrowernumber, $itemnumber)->{status} eq 'patronExpired', |
| 146 |
'Expired patron cannot reserve' |
| 147 |
); |
| 130 |
|
148 |
|
| 131 |
$holds = $item->current_holds; |
149 |
$holds = $item->current_holds; |
| 132 |
$first_hold = $holds->next; |
150 |
$first_hold = $holds->next; |
| 133 |
- |
|
|