Lines 24-29
use DateTime::Duration;
Link Here
|
24 |
use Koha::Database; |
24 |
use Koha::Database; |
25 |
use Koha::Item::Transfer; |
25 |
use Koha::Item::Transfer; |
26 |
use t::lib::TestBuilder; |
26 |
use t::lib::TestBuilder; |
|
|
27 |
use Test::Warn; |
27 |
|
28 |
|
28 |
use Test::More tests => 8; |
29 |
use Test::More tests => 8; |
29 |
|
30 |
|
Lines 159-165
subtest "Tests for repatriate." => sub {
Link Here
|
159 |
}; |
160 |
}; |
160 |
|
161 |
|
161 |
subtest "Tests for needs_advancing." => sub { |
162 |
subtest "Tests for needs_advancing." => sub { |
162 |
plan tests => 6; |
163 |
plan tests => 7; |
163 |
$schema->storage->txn_begin; |
164 |
$schema->storage->txn_begin; |
164 |
|
165 |
|
165 |
# Test behaviour of item freshly added to rota. |
166 |
# Test behaviour of item freshly added to rota. |
Lines 223-228
subtest "Tests for needs_advancing." => sub {
Link Here
|
223 |
DateTime->now - DateTime::Duration->new( days => 75 ) |
224 |
DateTime->now - DateTime::Duration->new( days => 75 ) |
224 |
)->store; |
225 |
)->store; |
225 |
is($dbitem->needs_advancing, 1, "Ready to be advanced."); |
226 |
is($dbitem->needs_advancing, 1, "Ready to be advanced."); |
|
|
227 |
$dbtransfer->delete; |
228 |
warning_is {$dbitem->needs_advancing} "We have no historical branch transfer for itemnumber " . $dbitem->itemnumber->itemnumber . "; This should not have happened!", "Missing transfer is warned."; |
226 |
|
229 |
|
227 |
$schema->storage->txn_rollback; |
230 |
$schema->storage->txn_rollback; |
228 |
}; |
231 |
}; |
229 |
- |
|
|