Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 14; |
22 |
use Test::More tests => 15; |
23 |
|
23 |
|
24 |
use Test::MockModule; |
24 |
use Test::MockModule; |
25 |
use Test::Exception; |
25 |
use Test::Exception; |
Lines 1483-1488
subtest 'filter_by_for_loan' => sub {
Link Here
|
1483 |
$biblio->delete; |
1483 |
$biblio->delete; |
1484 |
}; |
1484 |
}; |
1485 |
|
1485 |
|
|
|
1486 |
subtest 'filter_by_for_hold' => sub { |
1487 |
plan tests => 4; |
1488 |
|
1489 |
my $biblio = $builder->build_sample_biblio; |
1490 |
is( $biblio->items->filter_by_for_hold->count, 0, 'no item yet' ); |
1491 |
$builder->build_sample_item( { biblionumber => $biblio->biblionumber, notforloan => 1 } ); |
1492 |
is( $biblio->items->filter_by_for_hold->count, 0, 'no item for hold' ); |
1493 |
$builder->build_sample_item( { biblionumber => $biblio->biblionumber, notforloan => 0 } ); |
1494 |
is( $biblio->items->filter_by_for_hold->count, 1, '1 item for hold' ); |
1495 |
$builder->build_sample_item( { biblionumber => $biblio->biblionumber, notforloan => -1 } ); |
1496 |
is( $biblio->items->filter_by_for_hold->count, 2, '2 items for hold' ); |
1497 |
|
1498 |
$biblio->delete; |
1499 |
}; |
1500 |
|
1486 |
# Reset nb_of_items prior to testing delete |
1501 |
# Reset nb_of_items prior to testing delete |
1487 |
$nb_of_items = Koha::Items->search->count; |
1502 |
$nb_of_items = Koha::Items->search->count; |
1488 |
|
1503 |
|
1489 |
- |
|
|