Lines 300-306
subtest 'LookupPatron test' => sub {
Link Here
|
300 |
|
300 |
|
301 |
subtest 'Holds test' => sub { |
301 |
subtest 'Holds test' => sub { |
302 |
|
302 |
|
303 |
plan tests => 7; |
303 |
plan tests => 8; |
304 |
|
304 |
|
305 |
$schema->storage->txn_begin; |
305 |
$schema->storage->txn_begin; |
306 |
|
306 |
|
Lines 427-432
subtest 'Holds test' => sub {
Link Here
|
427 |
is( $reply->{code}, 'alreadypossession', "Patron has issued same book" ); |
427 |
is( $reply->{code}, 'alreadypossession', "Patron has issued same book" ); |
428 |
is( $reply->{pickup_location}, undef, "No reserve placed"); |
428 |
is( $reply->{pickup_location}, undef, "No reserve placed"); |
429 |
|
429 |
|
|
|
430 |
# Test Patron cannot reserve if expired and BlockExpiredPatronOpacActions |
431 |
my $category = $builder->build({ |
432 |
source => 'Category', |
433 |
value => { BlockExpiredPatronOpacActions => -1 } |
434 |
}); |
435 |
|
436 |
my $branch_1 = $builder->build({ source => 'Branch' })->{ branchcode }; |
437 |
|
438 |
my $expired_borrowernumber = Koha::Patron->new({ |
439 |
firstname => 'Expired', |
440 |
surname => 'Patron', |
441 |
categorycode => $category->{categorycode}, |
442 |
branchcode => $branch_1, |
443 |
dateexpiry => '2000-01-01', |
444 |
})->store->borrowernumber; |
445 |
|
446 |
t::lib::Mocks::mock_preference('BlockExpiredPatronOpacActions', 1); |
447 |
|
448 |
my $item5 = $builder->build({ |
449 |
source => 'Item', |
450 |
value => { |
451 |
biblionumber => $biblio_with_no_item->{biblionumber}, |
452 |
damaged => 0, |
453 |
} |
454 |
}); |
455 |
|
456 |
$query = new CGI; |
457 |
$query->param( 'patron_id', $expired_borrowernumber); |
458 |
$query->param( 'bib_id', $biblio_with_no_item->{biblionumber}); |
459 |
$query->param( 'item_id', $item5->{itemnumber}); |
460 |
|
461 |
$reply = C4::ILSDI::Services::HoldItem( $query ); |
462 |
is( $reply->{code}, 'PatronExpired', "Patron is expired" ); |
463 |
|
430 |
$schema->storage->txn_rollback; |
464 |
$schema->storage->txn_rollback; |
431 |
}; |
465 |
}; |
432 |
|
466 |
|
433 |
- |
|
|