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

(-)a/t/db_dependent/Holds.t (-3 / +20 lines)
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
12
13
use C4::Biblio;
13
use C4::Biblio;
Lines 42-48 my $dbh = C4::Context->dbh; Link Here
42
my $branch_1 = $builder->build({ source => 'Branch' })->{ branchcode };
42
my $branch_1 = $builder->build({ source => 'Branch' })->{ branchcode };
43
my $branch_2 = $builder->build({ source => 'Branch' })->{ branchcode };
43
my $branch_2 = $builder->build({ source => 'Branch' })->{ branchcode };
44
44
45
my $category = $builder->build({ source => 'Category' });
45
my $category = $builder->build({
46
    source => 'Category',
47
    value => {
48
        BlockExpiredPatronOpacActions => -1,
49
    },
50
});
46
51
47
my $borrowers_count = 5;
52
my $borrowers_count = 5;
48
53
Lines 131-136 my $patron = Koha::Patrons->find( $borrowernumbers[0] ); Link Here
131
$holds = $patron->holds;
136
$holds = $patron->holds;
132
is( $holds->next->borrowernumber, $borrowernumbers[0], "Test Koha::Patron->holds");
137
is( $holds->next->borrowernumber, $borrowernumbers[0], "Test Koha::Patron->holds");
133
138
139
my $expired_borrowernumber = Koha::Patron->new({
140
        firstname =>  'Expired',
141
        surname => 'Patron',
142
        categorycode => $category->{categorycode},
143
        branchcode => $branch_1,
144
	dateexpiry => '2000-01-01',
145
    })->store->borrowernumber;
146
147
t::lib::Mocks::mock_preference('BlockExpiredPatronOpacActions', 1);
148
ok(
149
    CanItemBeReserved($expired_borrowernumber, $itemnumber)->{status} eq 'patronExpired',
150
    'Expired patron cannot reserve'
151
);
134
152
135
$holds = $item->current_holds;
153
$holds = $item->current_holds;
136
$first_hold = $holds->next;
154
$first_hold = $holds->next;
137
- 

Return to bug 17229