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

(-)a/t/db_dependent/Koha/Item.t (-2 / +19 lines)
Lines 762-768 subtest 'pickup_locations() tests' => sub { Link Here
762
};
762
};
763
763
764
subtest 'request_transfer' => sub {
764
subtest 'request_transfer' => sub {
765
    plan tests => 13;
765
    plan tests => 17;
766
    $schema->storage->txn_begin;
766
    $schema->storage->txn_begin;
767
767
768
    my $library1 = $builder->build_object( { class => 'Koha::Libraries' } );
768
    my $library1 = $builder->build_object( { class => 'Koha::Libraries' } );
Lines 822-827 subtest 'request_transfer' => sub { Link Here
822
    is($transfers->count, 1, "There is only 1 live transfer in the queue");
822
    is($transfers->count, 1, "There is only 1 live transfer in the queue");
823
    $replaced_transfer->datearrived(dt_from_string)->store();
823
    $replaced_transfer->datearrived(dt_from_string)->store();
824
824
825
    # Replace StockrotationAdvance transfer
826
    my $stock_transfer = $item->request_transfer( { to => $library1, reason => 'StockrotationAdvance' } );
827
    is(
828
        ref($stock_transfer), 'Koha::Item::Transfer',
829
        'Koha::Item->request_transfer added StockrotationAdvance transfer'
830
    );
831
    $replaced_transfer = $item->request_transfer( { to => $library2, reason => 'Manual', replace => 1 } );
832
    is(
833
        ref($replaced_transfer), 'Koha::Item::Transfer',
834
        'Koha::Item->request_transfer allowed when replace is set'
835
    );
836
    $stock_transfer->discard_changes;
837
    is( $stock_transfer->datecancelled, undef, "StockrotationAdvance transfer left intact" );
838
    $transfers = $item->get_transfers;
839
    is( $transfers->count, 2, "There are now 2 live transfers in the queue" );
840
    $replaced_transfer->datearrived(dt_from_string)->store();
841
    $stock_transfer->datearrived(dt_from_string)->store();
842
825
    # BranchTransferLimits
843
    # BranchTransferLimits
826
    t::lib::Mocks::mock_preference('UseBranchTransferLimits', 1);
844
    t::lib::Mocks::mock_preference('UseBranchTransferLimits', 1);
827
    t::lib::Mocks::mock_preference('BranchTransferLimitsType', 'itemtype');
845
    t::lib::Mocks::mock_preference('BranchTransferLimitsType', 'itemtype');
828
- 

Return to bug 35100