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 413-418
my $res_id = AddReserve( $branch_1, $borrowernumbers[0], $biblio->biblionumber,
Link Here
|
413 |
is( CanItemBeReserved( $borrowernumbers[0], $itemnumber )->{status}, |
418 |
is( CanItemBeReserved( $borrowernumbers[0], $itemnumber )->{status}, |
414 |
'tooManyReserves', 'Patron cannot reserve item with hold limit of 1, 1 bib level hold placed' ); |
419 |
'tooManyReserves', 'Patron cannot reserve item with hold limit of 1, 1 bib level hold placed' ); |
415 |
|
420 |
|
|
|
421 |
<<<<<<< HEAD |
416 |
subtest 'Test max_holds per library/patron category' => sub { |
422 |
subtest 'Test max_holds per library/patron category' => sub { |
417 |
plan tests => 6; |
423 |
plan tests => 6; |
418 |
|
424 |
|
Lines 452-457
subtest 'Test max_holds per library/patron category' => sub {
Link Here
|
452 |
rule_value => 3, |
458 |
rule_value => 3, |
453 |
} |
459 |
} |
454 |
); |
460 |
); |
|
|
461 |
======= |
462 |
my $expired_borrowernumber = AddMember( |
463 |
firstname => 'Expired', |
464 |
surname => 'Patron', |
465 |
categorycode => $category->{categorycode}, |
466 |
branchcode => $branch_1, |
467 |
dateexpiry => '2000-01-01', |
468 |
); |
469 |
t::lib::Mocks::mock_preference('BlockExpiredPatronOpacActions', 1); |
470 |
is(CanItemBeReserved($expired_borrowernumber, $itemnumber), |
471 |
'expired', 'Expired patron cannot reserve'); |
472 |
|
473 |
>>>>>>> Bug 17229: Add unit test for BlockExpiredPatronOpacActions check |
455 |
|
474 |
|
456 |
my $rule_branch = Koha::CirculationRules->set_rule( |
475 |
my $rule_branch = Koha::CirculationRules->set_rule( |
457 |
{ |
476 |
{ |
458 |
- |
|
|