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

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

Return to bug 22806