Lines 18-24
Link Here
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
use utf8; |
19 |
use utf8; |
20 |
|
20 |
|
21 |
use Test::More tests => 65; |
21 |
use Test::More tests => 66; |
22 |
use Test::Exception; |
22 |
use Test::Exception; |
23 |
use Test::MockModule; |
23 |
use Test::MockModule; |
24 |
use Test::Deep qw( cmp_deeply ); |
24 |
use Test::Deep qw( cmp_deeply ); |
Lines 5818-5823
subtest 'Tests for BlockReturnOfWithdrawnItems' => sub {
Link Here
|
5818 |
[ 0, { NotIssued => $item->barcode, withdrawn => 1 }, undef, {} ], "Item returned as withdrawn, no other messages"); |
5818 |
[ 0, { NotIssued => $item->barcode, withdrawn => 1 }, undef, {} ], "Item returned as withdrawn, no other messages"); |
5819 |
}; |
5819 |
}; |
5820 |
|
5820 |
|
|
|
5821 |
subtest 'Tests for transfer not in transit' => sub { |
5822 |
|
5823 |
plan tests => 2; |
5824 |
|
5825 |
|
5826 |
# These tests are to ensure a 'pending' transfer, generated by |
5827 |
# stock rotation, will be advanced when checked in |
5828 |
|
5829 |
my $item = $builder->build_sample_item(); |
5830 |
my $transfer = $builder->build_object({ class => 'Koha::Item::Transfers', value => { |
5831 |
itemnumber => $item->id, |
5832 |
reason => 'StockrotationRepatriation', |
5833 |
datesent => undef, |
5834 |
frombranch => $item->homebranch, |
5835 |
}}); |
5836 |
my @return = AddReturn( $item->barcode, $item->homebranch, 0, undef ); |
5837 |
is_deeply( |
5838 |
\@return, |
5839 |
[ 0, { WasTransfered => $transfer->tobranch, TransferTrigger => 'StockrotationRepatriation', NotIssued => $item->barcode }, undef, {} ], "Item is reported to have been transferred"); |
5840 |
|
5841 |
$transfer->discard_changes; |
5842 |
ok( $transfer->datesent, 'The datesent field is populated, i.e. transfer is initiated'); |
5843 |
|
5844 |
}; |
5845 |
|
5821 |
$schema->storage->txn_rollback; |
5846 |
$schema->storage->txn_rollback; |
5822 |
C4::Context->clear_syspref_cache(); |
5847 |
C4::Context->clear_syspref_cache(); |
5823 |
$branches = Koha::Libraries->search(); |
5848 |
$branches = Koha::Libraries->search(); |