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 => 7; |
306 |
|
306 |
|
307 |
$schema->storage->txn_begin; |
307 |
$schema->storage->txn_begin; |
308 |
|
308 |
|
Lines 418-423
subtest 'Holds test' => sub {
Link Here
|
418 |
source => 'Item', |
418 |
source => 'Item', |
419 |
value => { |
419 |
value => { |
420 |
biblionumber => $biblio3->{biblionumber}, |
420 |
biblionumber => $biblio3->{biblionumber}, |
|
|
421 |
barcode => '123456789', |
421 |
damaged => 0, |
422 |
damaged => 0, |
422 |
} |
423 |
} |
423 |
}); |
424 |
}); |
Lines 448-453
subtest 'Holds test' => sub {
Link Here
|
448 |
$reply = C4::ILSDI::Services::HoldItem( $query ); |
449 |
$reply = C4::ILSDI::Services::HoldItem( $query ); |
449 |
is( $reply->{code}, 'damaged', "Item is damaged" ); |
450 |
is( $reply->{code}, 'damaged', "Item is damaged" ); |
450 |
|
451 |
|
|
|
452 |
t::lib::Mocks::mock_preference( 'AllowHoldsOnPatronsPossessions', '0' ); |
453 |
|
454 |
my $mock_patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
455 |
t::lib::Mocks::mock_userenv( { patron => $mock_patron } ); # For AddIssue |
456 |
my $checkout = C4::Circulation::AddIssue( $mock_patron->unblessed, $item->{barcode} ); |
457 |
|
458 |
$query->param( 'patron_id', $mock_patron->borrowernumber); |
459 |
$query->param( 'bib_id', $biblio3->{biblionumber}); |
460 |
$query->param( 'item_id', $item3->{itemnumber}); |
461 |
$reply = C4::ILSDI::Services::HoldItem( $query ); |
462 |
is( $reply->{code}, 'itemAlreadyOnLoan', "Patron has issued same book" ); |
463 |
is( $reply->{pickup_location}, undef, "No reserve placed"); |
464 |
|
451 |
$schema->storage->txn_rollback; |
465 |
$schema->storage->txn_rollback; |
452 |
}; |
466 |
}; |
453 |
|
467 |
|
454 |
- |
|
|