Lines 20-26
Link Here
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
use utf8; |
21 |
use utf8; |
22 |
|
22 |
|
23 |
use Test::More tests => 28; |
23 |
use Test::More tests => 29; |
24 |
use Test::Exception; |
24 |
use Test::Exception; |
25 |
use Test::MockModule; |
25 |
use Test::MockModule; |
26 |
|
26 |
|
Lines 2175-2177
subtest 'is_denied_renewal' => sub {
Link Here
|
2175 |
|
2175 |
|
2176 |
$schema->storage->txn_rollback; |
2176 |
$schema->storage->txn_rollback; |
2177 |
}; |
2177 |
}; |
2178 |
- |
2178 |
|
|
|
2179 |
subtest 'current_branchtransfers relationship' => sub { |
2180 |
plan tests => 3; |
2181 |
|
2182 |
$schema->storage->txn_begin; |
2183 |
|
2184 |
my $biblio = $builder->build_sample_biblio(); |
2185 |
my $item = $builder->build_sample_item({ |
2186 |
biblionumber => $biblio->biblionumber, |
2187 |
}); |
2188 |
my $transfers = $item->_result->current_branchtransfers; |
2189 |
is( ref($transfers), 'DBIx::Class::ResultSet', 'current_branchtransfers returns a Koha::Item::Transfers object set' ); |
2190 |
is($transfers->count, 0, "Empty Koha::Item::Transfers set returned if no return_claims"); |
2191 |
my $transfer1 = $builder->build({ source => 'Branchtransfer', value => { |
2192 |
itemnumber => $item->itemnumber, |
2193 |
datearrived => dt_from_string, |
2194 |
}}); |
2195 |
my $transfer2 = $builder->build({ source => 'Branchtransfer', value => { |
2196 |
itemnumber => $item->itemnumber, |
2197 |
datearrived => undef, |
2198 |
datecancelled => dt_from_string, |
2199 |
}}); |
2200 |
my $transfer3 = $builder->build({ source => 'Branchtransfer', value => { |
2201 |
itemnumber => $item->itemnumber, |
2202 |
datearrived => undef, |
2203 |
datecancelled => undef, |
2204 |
}}); |
2205 |
|
2206 |
is($item->_result->current_branchtransfers()->count, 1, "One transfer found for item"); |
2207 |
|
2208 |
$schema->storage->txn_rollback; |
2209 |
}; |