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