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

(-)a/t/db_dependent/Koha/Item.t (-2 / +19 lines)
Lines 846-852 subtest 'pickup_locations() tests' => sub { Link Here
846
};
846
};
847
847
848
subtest 'request_transfer' => sub {
848
subtest 'request_transfer' => sub {
849
    plan tests => 13;
849
    plan tests => 17;
850
    $schema->storage->txn_begin;
850
    $schema->storage->txn_begin;
851
851
852
    my $library1 = $builder->build_object( { class => 'Koha::Libraries' } );
852
    my $library1 = $builder->build_object( { class => 'Koha::Libraries' } );
Lines 906-911 subtest 'request_transfer' => sub { Link Here
906
    is($transfers->count, 1, "There is only 1 live transfer in the queue");
906
    is($transfers->count, 1, "There is only 1 live transfer in the queue");
907
    $replaced_transfer->datearrived(dt_from_string)->store();
907
    $replaced_transfer->datearrived(dt_from_string)->store();
908
908
909
    # Replace StockrotationAdvance transfer
910
    my $stock_transfer = $item->request_transfer( { to => $library1, reason => 'StockrotationAdvance' } );
911
    is(
912
        ref($stock_transfer), 'Koha::Item::Transfer',
913
        'Koha::Item->request_transfer added StockrotationAdvance transfer'
914
    );
915
    $replaced_transfer = $item->request_transfer( { to => $library2, reason => 'Manual', replace => 1 } );
916
    is(
917
        ref($replaced_transfer), 'Koha::Item::Transfer',
918
        'Koha::Item->request_transfer allowed when replace is set'
919
    );
920
    $stock_transfer->discard_changes;
921
    is( $stock_transfer->datecancelled, undef, "StockrotationAdvance transfer left intact" );
922
    $transfers = $item->get_transfers;
923
    is( $transfers->count, 2, "There are now 2 live transfers in the queue" );
924
    $replaced_transfer->datearrived(dt_from_string)->store();
925
    $stock_transfer->datearrived(dt_from_string)->store();
926
909
    # BranchTransferLimits
927
    # BranchTransferLimits
910
    t::lib::Mocks::mock_preference('UseBranchTransferLimits', 1);
928
    t::lib::Mocks::mock_preference('UseBranchTransferLimits', 1);
911
    t::lib::Mocks::mock_preference('BranchTransferLimitsType', 'itemtype');
929
    t::lib::Mocks::mock_preference('BranchTransferLimitsType', 'itemtype');
912
- 

Return to bug 35100