|
Lines 17-23
Link Here
|
| 17 |
|
17 |
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
|
19 |
|
| 20 |
use Test::More tests => 116; |
20 |
use Test::More tests => 117; |
| 21 |
|
21 |
|
| 22 |
use DateTime; |
22 |
use DateTime; |
| 23 |
use POSIX qw( floor ); |
23 |
use POSIX qw( floor ); |
|
Lines 2214-2219
subtest 'CanBookBeIssued | is_overdue' => sub {
Link Here
|
| 2214 |
|
2214 |
|
| 2215 |
}; |
2215 |
}; |
| 2216 |
|
2216 |
|
|
|
2217 |
subtest 'AddReturn should clear items.onloan for unissued items' => sub { |
| 2218 |
plan tests => 1; |
| 2219 |
|
| 2220 |
t::lib::Mocks::mock_preference( "AllowReturnToBranch", 'anywhere' ); |
| 2221 |
my $item = $builder->build_object({ class => 'Koha::Items', value => { onloan => '2018-01-01' }}); |
| 2222 |
AddReturn( $item->barcode, $item->homebranch ); |
| 2223 |
$item->discard_changes; # refresh |
| 2224 |
is( $item->onloan, undef, 'AddReturn did clear items.onloan' ); |
| 2225 |
}; |
| 2217 |
|
2226 |
|
| 2218 |
$schema->storage->txn_rollback; |
2227 |
$schema->storage->txn_rollback; |
| 2219 |
$cache->clear_from_cache('single_holidays'); |
2228 |
$cache->clear_from_cache('single_holidays'); |
| 2220 |
- |
|
|