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