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

(-)a/t/db_dependent/Holds.t (-3 / +21 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 = Koha::Patron->new({
138
        firstname =>  'Expired',
139
        surname => 'Patron',
140
        categorycode => $category->{categorycode},
141
        branchcode => $branch_1,
142
    	dateexpiry => '2000-01-01',
143
    })->store->borrowernumber;
144
145
t::lib::Mocks::mock_preference('BlockExpiredPatronOpacActions', 1);
146
ok(
147
    CanItemBeReserved($expired_borrowernumber, $itemnumber)->{status} eq 'patronExpired',
148
    'Expired patron cannot reserve'
149
);
132
150
133
$holds = $item->current_holds;
151
$holds = $item->current_holds;
134
$first_hold = $holds->next;
152
$first_hold = $holds->next;
Lines 656-658 subtest 'CanItemBeReserved / holds_per_day tests' => sub { Link Here
656
674
657
    $schema->storage->txn_rollback;
675
    $schema->storage->txn_rollback;
658
};
676
};
659
- 
677

Return to bug 17229