View | Details | Raw Unified | Return to bug 22806
Collapse All | Expand All

(-)a/t/db_dependent/ILSDI_Services.t (-2 / +17 lines)
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
    $patron = $builder->build_object({ class => 'Koha::Patrons' });
453
    my $module = new Test::MockModule('C4::Context');
454
    $module->mock('userenv', sub { { patron => $patron } });
455
    my $date_due = DateTime->now->add(weeks => 2);
456
    my $issue = C4::Circulation::AddIssue($patron->unblessed, $item3->{barcode}, $date_due);
457
    t::lib::Mocks::mock_preference( 'AllowHoldsOnPatronsPossessions', '0' );
458
459
    $query->param( 'patron_id', $patron->borrowernumber);
460
    $query->param( 'bib_id', $biblio3->{biblionumber});
461
    $query->param( 'item_id', $item3->{itemnumber});
462
    $reply = C4::ILSDI::Services::HoldItem( $query );
463
464
    is( $reply->{code}, 'itemAlreadyOnLoan', "Patron has issued same book" );
465
    is( $reply->{pickup_location}, undef, "No reserve placed");
466
451
    $schema->storage->txn_rollback;
467
    $schema->storage->txn_rollback;
452
};
468
};
453
469
454
- 

Return to bug 22806