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

(-)a/t/db_dependent/Circulation.t (-43 / +2 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 => 67;
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 33-39 use t::lib::TestBuilder; Link Here
33
33
34
use C4::Accounts;
34
use C4::Accounts;
35
use C4::Calendar qw( new insert_single_holiday insert_week_day_holiday delete_holiday );
35
use C4::Calendar qw( new insert_single_holiday insert_week_day_holiday delete_holiday );
36
use C4::Circulation qw( AddIssue AddReturn CanBookBeRenewed GetIssuingCharges AddRenewal GetSoonestRenewDate GetLatestAutoRenewDate LostItem GetUpcomingDueIssues CanBookBeIssued AddIssuingCharge MarkIssueReturned ProcessOfflinePayment transferbook updateWrongTransfer );
36
use C4::Circulation qw( AddIssue AddReturn CanBookBeRenewed GetIssuingCharges AddRenewal GetSoonestRenewDate GetLatestAutoRenewDate LostItem GetUpcomingDueIssues CanBookBeIssued AddIssuingCharge MarkIssueReturned ProcessOfflinePayment transferbook );
37
use C4::Biblio;
37
use C4::Biblio;
38
use C4::Items qw( ModItemTransfer );
38
use C4::Items qw( ModItemTransfer );
39
use C4::Log;
39
use C4::Log;
Lines 5843-5888 subtest "Item's onloan value should be set if checked out item is checked out to Link Here
5843
    ok( $item->get_from_storage->onloan, "Item's onloan column is set after second checkout" );
5843
    ok( $item->get_from_storage->onloan, "Item's onloan column is set after second checkout" );
5844
};
5844
};
5845
5845
5846
subtest "updateWrongTransfer tests" => sub {
5847
    plan tests => 5;
5848
5849
    my $library1 = $builder->build_object( { class => 'Koha::Libraries' } );
5850
    my $library2 = $builder->build_object( { class => 'Koha::Libraries' } );
5851
    my $library3 = $builder->build_object( { class => 'Koha::Libraries' } );
5852
    my $item     = $builder->build_sample_item(
5853
        {
5854
            homebranch    => $library1->branchcode,
5855
            holdingbranch => $library2->branchcode,
5856
            datelastseen  => undef
5857
        }
5858
    );
5859
5860
    my $transfer = $builder->build_object(
5861
        {
5862
            class => 'Koha::Item::Transfers',
5863
            value => {
5864
                itemnumber    => $item->itemnumber,
5865
                frombranch    => $library2->branchcode,
5866
                tobranch      => $library1->branchcode,
5867
                daterequested => dt_from_string,
5868
                datesent      => dt_from_string,
5869
                datecancelled => undef,
5870
                datearrived   => undef,
5871
                reason        => 'Manual'
5872
            }
5873
        }
5874
    );
5875
    is( ref($transfer), 'Koha::Item::Transfer', 'Mock transfer added' );
5876
5877
    my $new_transfer = C4::Circulation::updateWrongTransfer($item->itemnumber, $library1->branchcode);
5878
    is(ref($new_transfer), 'Koha::Item::Transfer', "updateWrongTransfer returns a 'Koha::Item::Transfer' object");
5879
    ok( !$new_transfer->in_transit, "New transfer is NOT created as in transit (or cancelled)");
5880
5881
    my $original_transfer = $transfer->get_from_storage;
5882
    ok( defined($original_transfer->datecancelled), "Original transfer was cancelled");
5883
    is( $original_transfer->cancellation_reason, 'WrongTransfer', "Original transfer cancellation reason is 'WrongTransfer'");
5884
};
5885
5886
subtest "SendCirculationAlert" => sub {
5846
subtest "SendCirculationAlert" => sub {
5887
    plan tests => 3;
5847
    plan tests => 3;
5888
5848
5889
- 

Return to bug 28294