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

(-)a/t/db_dependent/Holds.t (-3 / +18 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 => 57;
10
use Test::More tests => 58;
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 129-134 my $patron = Koha::Patrons->find( $borrowernumbers[0] ); Link Here
129
$holds = $patron->holds;
134
$holds = $patron->holds;
130
is( $holds->next->borrowernumber, $borrowernumbers[0], "Test Koha::Patron->holds");
135
is( $holds->next->borrowernumber, $borrowernumbers[0], "Test Koha::Patron->holds");
131
136
137
my $expired_borrowernumber = AddMember(
138
    firstname =>  'Expired',
139
    surname => 'Patron',
140
    categorycode => $category->{categorycode},
141
    branchcode => $branch_1,
142
    dateexpiry => '2000-01-01',
143
);
144
t::lib::Mocks::mock_preference('BlockExpiredPatronOpacActions', 1);
145
is(CanItemBeReserved($expired_borrowernumber, $itemnumber),
146
    'expired', 'Expired patron cannot reserve');
132
147
133
$holds = $item->current_holds;
148
$holds = $item->current_holds;
134
$first_hold = $holds->next;
149
$first_hold = $holds->next;
Lines 656-658 subtest 'CanItemBeReserved / holds_per_day tests' => sub { Link Here
656
671
657
    $schema->storage->txn_rollback;
672
    $schema->storage->txn_rollback;
658
};
673
};
659
- 
674

Return to bug 17229