Lines 757-763
subtest 'pickup_locations() tests' => sub {
Link Here
|
757 |
}; |
757 |
}; |
758 |
|
758 |
|
759 |
subtest 'request_transfer' => sub { |
759 |
subtest 'request_transfer' => sub { |
760 |
plan tests => 13; |
760 |
plan tests => 17; |
761 |
$schema->storage->txn_begin; |
761 |
$schema->storage->txn_begin; |
762 |
|
762 |
|
763 |
my $library1 = $builder->build_object( { class => 'Koha::Libraries' } ); |
763 |
my $library1 = $builder->build_object( { class => 'Koha::Libraries' } ); |
Lines 817-822
subtest 'request_transfer' => sub {
Link Here
|
817 |
is($transfers->count, 1, "There is only 1 live transfer in the queue"); |
817 |
is($transfers->count, 1, "There is only 1 live transfer in the queue"); |
818 |
$replaced_transfer->datearrived(dt_from_string)->store(); |
818 |
$replaced_transfer->datearrived(dt_from_string)->store(); |
819 |
|
819 |
|
|
|
820 |
# Replace StockrotationAdvance transfer |
821 |
my $stock_transfer = $item->request_transfer( { to => $library1, reason => 'StockrotationAdvance' } ); |
822 |
is( |
823 |
ref($stock_transfer), 'Koha::Item::Transfer', |
824 |
'Koha::Item->request_transfer added StockrotationAdvance transfer' |
825 |
); |
826 |
$replaced_transfer = $item->request_transfer( { to => $library2, reason => 'Manual', replace => 1 } ); |
827 |
is( |
828 |
ref($replaced_transfer), 'Koha::Item::Transfer', |
829 |
'Koha::Item->request_transfer allowed when replace is set' |
830 |
); |
831 |
$stock_transfer->discard_changes; |
832 |
is( $stock_transfer->datecancelled, undef, "StockrotationAdvance transfer left intact" ); |
833 |
$transfers = $item->get_transfers; |
834 |
is( $transfers->count, 2, "There are now 2 live transfers in the queue" ); |
835 |
$replaced_transfer->datearrived(dt_from_string)->store(); |
836 |
$stock_transfer->datearrived(dt_from_string)->store(); |
837 |
|
820 |
# BranchTransferLimits |
838 |
# BranchTransferLimits |
821 |
t::lib::Mocks::mock_preference('UseBranchTransferLimits', 1); |
839 |
t::lib::Mocks::mock_preference('UseBranchTransferLimits', 1); |
822 |
t::lib::Mocks::mock_preference('BranchTransferLimitsType', 'itemtype'); |
840 |
t::lib::Mocks::mock_preference('BranchTransferLimitsType', 'itemtype'); |
823 |
- |
|
|