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

Return to bug 17229