|
Lines 19-25
Link Here
|
| 19 |
|
19 |
|
| 20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
| 21 |
|
21 |
|
| 22 |
use Test::More tests => 9; |
22 |
use Test::More tests => 10; |
| 23 |
use Test::Exception; |
23 |
use Test::Exception; |
| 24 |
|
24 |
|
| 25 |
use C4::Circulation; |
25 |
use C4::Circulation; |
|
Lines 81-86
subtest 'get_transfer' => sub {
Link Here
|
| 81 |
is( $transfer->itemnumber, $new_item_1->itemnumber, 'Koha::Item->get_transfer should return a valid Koha::Item::Transfers object' ); |
81 |
is( $transfer->itemnumber, $new_item_1->itemnumber, 'Koha::Item->get_transfer should return a valid Koha::Item::Transfers object' ); |
| 82 |
}; |
82 |
}; |
| 83 |
|
83 |
|
|
|
84 |
subtest 'holds' => sub { |
| 85 |
plan tests => 5; |
| 86 |
|
| 87 |
my $biblio = $builder->build_sample_biblio(); |
| 88 |
my $item = $builder->build_sample_item({ |
| 89 |
biblionumber => $biblio->biblionumber, |
| 90 |
}); |
| 91 |
$nb_of_items++; |
| 92 |
is($item->holds(), undef, "Nothing returned if no holds"); |
| 93 |
my $hold1 = $builder->build({ source => 'Reserve', value => { itemnumber=>$item->itemnumber, found => 'T' }}); |
| 94 |
my $hold2 = $builder->build({ source => 'Reserve', value => { itemnumber=>$item->itemnumber, found => 'W' }}); |
| 95 |
my $hold3 = $builder->build({ source => 'Reserve', value => { itemnumber=>$item->itemnumber, found => 'W' }}); |
| 96 |
|
| 97 |
is($item->holds()->count,3,"Three holds found"); |
| 98 |
is($item->holds({found => 'W'})->count,2,"Two waiting holds found"); |
| 99 |
is_deeply($item->holds({found => 'T'})->next->unblessed,$hold1,"Found transit holds matches the hold"); |
| 100 |
is($item->holds({found => undef}),undef,"Nothing returned if no matching holds"); |
| 101 |
}; |
| 102 |
|
| 84 |
subtest 'biblio' => sub { |
103 |
subtest 'biblio' => sub { |
| 85 |
plan tests => 2; |
104 |
plan tests => 2; |
| 86 |
|
105 |
|
| 87 |
- |
|
|