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

(-)a/t/db_dependent/SIP/Transaction.t (-2 / +38 lines)
Lines 4-10 Link Here
4
# Current state is very rudimentary. Please help to extend it!
4
# Current state is very rudimentary. Please help to extend it!
5
5
6
use Modern::Perl;
6
use Modern::Perl;
7
use Test::More tests => 15;
7
use Test::More tests => 16;
8
8
9
use Koha::Database;
9
use Koha::Database;
10
use t::lib::TestBuilder;
10
use t::lib::TestBuilder;
Lines 529-534 subtest do_checkout_with_patron_blocked => sub { Link Here
529
529
530
};
530
};
531
531
532
subtest do_checkout_with_noblock => sub {
533
    plan tests => 3;
534
535
    my $library = $builder->build_object( { class => 'Koha::Libraries' } );
536
    my $patron = $builder->build_object(
537
        {
538
            class => 'Koha::Patrons',
539
            value => {
540
                branchcode => $library->branchcode,
541
                debarred => '9999/01/01',
542
            },
543
        }
544
    );
545
546
    t::lib::Mocks::mock_userenv(
547
        { branchcode => $library->branchcode, flags => 1 } );
548
549
    my $item = $builder->build_sample_item(
550
        {
551
            library => $library->branchcode,
552
        }
553
    );
554
555
556
    my $sip_patron  = C4::SIP::ILS::Patron->new( $patron->cardnumber );
557
    my $sip_item    = C4::SIP::ILS::Item->new( $item->barcode );
558
    my $co_transaction = C4::SIP::ILS::Transaction::Checkout->new();
559
    is( $co_transaction->patron($sip_patron),
560
        $sip_patron, "Patron assigned to transaction" );
561
    is( $co_transaction->item($sip_item),
562
        $sip_item, "Item assigned to transaction" );
563
564
    $co_transaction->do_checkout(undef, '19990102    030405');
565
566
    is( $patron->checkouts->count, 1, 'No Block checkout was performed for debarred patron');
567
};
568
532
subtest do_checkout_with_holds => sub {
569
subtest do_checkout_with_holds => sub {
533
    plan tests => 7;
570
    plan tests => 7;
534
571
535
- 

Return to bug 12225