|
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 2578-2580
subtest 'filter_by_in_bundle' => sub {
Link Here
|
| 2578 |
$schema->storage->txn_rollback; |
2578 |
$schema->storage->txn_rollback; |
| 2579 |
|
2579 |
|
| 2580 |
}; |
2580 |
}; |
| 2581 |
- |
2581 |
|
|
|
2582 |
subtest 'filter_by_has_recalls' => sub { |
| 2583 |
plan tests => 2; |
| 2584 |
|
| 2585 |
$schema->storage->txn_begin; |
| 2586 |
|
| 2587 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
| 2588 |
|
| 2589 |
$biblio = $builder->build_sample_biblio( { author => 'Hall, Daria' } ); |
| 2590 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
| 2591 |
t::lib::Mocks::mock_userenv( { branchcode => $patron->branchcode } ); |
| 2592 |
|
| 2593 |
my $item = $builder->build_sample_item( |
| 2594 |
{ |
| 2595 |
biblionumber => $biblio->biblionumber, |
| 2596 |
library => $library->branchcode, |
| 2597 |
} |
| 2598 |
); |
| 2599 |
|
| 2600 |
C4::Circulation::AddIssue( $patron, $item->barcode ); |
| 2601 |
|
| 2602 |
is( $biblio->items->filter_by_has_recalls->count, 0, "0 items with recalls on this record" ); |
| 2603 |
|
| 2604 |
Koha::Recalls->add_recall( { biblio => $item->biblio, item => $item, patron => $patron } ); |
| 2605 |
|
| 2606 |
is( $biblio->items->filter_by_has_recalls->count, 1, "1 item with recalls on this record" ); |
| 2607 |
|
| 2608 |
$schema->storage->txn_rollback; |
| 2609 |
|
| 2610 |
}; |