View | Details | Raw Unified | Return to bug 29234
Collapse All | Expand All

(-)a/t/db_dependent/Circulation.t (-1 / +26 lines)
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();
(-)a/t/lib/TestBuilder.pm (-1 / +12 lines)
Lines 590-595 sub _gen_default_values { Link Here
590
            materials          => undef,
590
            materials          => undef,
591
            more_subfields_xml => undef,
591
            more_subfields_xml => undef,
592
        },
592
        },
593
        Branchtransfer => {
594
            daterequested      => dt_from_string(),
595
            datesent           => dt_from_string(),
596
            datearrived        => undef,
597
            datecancelled      => undef,
598
            reason             => undef,
599
            withdrawn          => 0,
600
            restricted         => 0,
601
            damaged            => 0,
602
            materials          => undef,
603
            more_subfields_xml => undef,
604
        },
593
        Category => {
605
        Category => {
594
            enrolmentfee => 0,
606
            enrolmentfee => 0,
595
            reservefee   => 0,
607
            reservefee   => 0,
596
- 

Return to bug 29234