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

(-)a/t/db_dependent/Koha/Items.t (-2 / +31 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 24;
22
use Test::More tests => 25;
23
23
24
use Test::MockModule;
24
use Test::MockModule;
25
use Test::Exception;
25
use Test::Exception;
Lines 2380-2382 subtest 'filter_by_in_bundle' => sub { Link Here
2380
    $schema->storage->txn_rollback;
2380
    $schema->storage->txn_rollback;
2381
2381
2382
};
2382
};
2383
- 
2383
2384
subtest 'filter_by_has_recalls' => sub {
2385
    plan tests => 2;
2386
2387
    $schema->storage->txn_begin;
2388
2389
    my $library = $builder->build_object( { class => 'Koha::Libraries' } );
2390
2391
    $biblio = $builder->build_sample_biblio( { author => 'Hall, Daria' } );
2392
    my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
2393
    t::lib::Mocks::mock_userenv( { branchcode => $patron->branchcode } );
2394
2395
    my $item = $builder->build_sample_item(
2396
        {
2397
            biblionumber => $biblio->biblionumber,
2398
            library      => $library->branchcode,
2399
        }
2400
    );
2401
2402
    C4::Circulation::AddIssue( $patron, $item->barcode );
2403
2404
    is( $biblio->items->filter_by_has_recalls->count, 0, "0 items with recalls on this record" );
2405
2406
    Koha::Recalls->add_recall( { biblio => $item->biblio, item => $item, patron => $patron } );
2407
2408
    is( $biblio->items->filter_by_has_recalls->count, 1, "1 item with recalls on this record" );
2409
2410
    $schema->storage->txn_rollback;
2411
2412
};

Return to bug 37334