Lines 302-308
subtest 'LookupPatron test' => sub {
Link Here
|
302 |
|
302 |
|
303 |
subtest 'Holds test' => sub { |
303 |
subtest 'Holds test' => sub { |
304 |
|
304 |
|
305 |
plan tests => 5; |
305 |
plan tests => 6; |
306 |
|
306 |
|
307 |
$schema->storage->txn_begin; |
307 |
$schema->storage->txn_begin; |
308 |
|
308 |
|
Lines 451-456
subtest 'Holds test' => sub {
Link Here
|
451 |
$reply = C4::ILSDI::Services::HoldItem( $query ); |
451 |
$reply = C4::ILSDI::Services::HoldItem( $query ); |
452 |
is( $reply->{code}, 'damaged', "Item is damaged" ); |
452 |
is( $reply->{code}, 'damaged', "Item is damaged" ); |
453 |
|
453 |
|
|
|
454 |
# Test Patron cannot reserve if expired and BlockExpiredPatronOpacActions |
455 |
my $category = $builder->build({ |
456 |
source => 'Category', |
457 |
value => { BlockExpiredPatronOpacActions => -1 } |
458 |
}); |
459 |
|
460 |
my $branch_1 = $builder->build({ source => 'Branch' })->{ branchcode }; |
461 |
|
462 |
my $expired_borrowernumber = Koha::Patron->new({ |
463 |
firstname => 'Expired', |
464 |
surname => 'Patron', |
465 |
categorycode => $category->{categorycode}, |
466 |
branchcode => $branch_1, |
467 |
dateexpiry => '2000-01-01', |
468 |
})->store->borrowernumber; |
469 |
|
470 |
t::lib::Mocks::mock_preference('BlockExpiredPatronOpacActions', 1); |
471 |
|
472 |
my $item5 = $builder->build({ |
473 |
source => 'Item', |
474 |
value => { |
475 |
biblionumber => $biblio->{biblionumber}, |
476 |
damaged => 0, |
477 |
} |
478 |
}); |
479 |
|
480 |
$query = new CGI; |
481 |
$query->param( 'patron_id', $expired_borrowernumber); |
482 |
$query->param( 'bib_id', $biblio->{biblionumber}); |
483 |
$query->param( 'item_id', $item5->{itemnumber}); |
484 |
|
485 |
$reply = C4::ILSDI::Services::HoldItem( $query ); |
486 |
is( $reply->{code}, 'PatronExpired', "Patron is expired" ); |
487 |
|
454 |
$schema->storage->txn_rollback; |
488 |
$schema->storage->txn_rollback; |
455 |
}; |
489 |
}; |
456 |
|
490 |
|
457 |
- |
|
|