From c6ccb9fa4d1b3306127183c30a913bce3ffc31f5 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 21 Jan 2021 14:49:48 +0000 Subject: [PATCH] Bug 24446: (QA follow-up) Fix ModItemTransfer tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Seems I missed passing trigger in the tests for ModItemTransfer. This patch corrects that oversight. Signed-off-by: Kathleen Milne Signed-off-by: Martin Renvoize Signed-off-by: Joonas Kylmälä --- t/db_dependent/Circulation/transfers.t | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/t/db_dependent/Circulation/transfers.t b/t/db_dependent/Circulation/transfers.t index 215afad81a..7ad80f31d6 100755 --- a/t/db_dependent/Circulation/transfers.t +++ b/t/db_dependent/Circulation/transfers.t @@ -111,10 +111,12 @@ my $item_id4 = Koha::Item->new( )->store->itemnumber; #Add transfers +my $trigger = 'Manual'; ModItemTransfer( $item_id1, $branchcode_1, - $branchcode_2 + $branchcode_2, + $trigger ); my $item_obj = Koha::Items->find({ itemnumber => $item_id1 }); @@ -123,14 +125,16 @@ is( $item_obj->holdingbranch, $branchcode_1, "Item should be held at branch that ModItemTransfer( $item_id2, $branchcode_1, - $branchcode_2 + $branchcode_2, + $trigger ); # Add an "unsent" transfer for tests ModItemTransfer( $item_id3, $branchcode_1, - $branchcode_2 + $branchcode_2, + $trigger ); my $transfer_requested = Koha::Item::Transfers->search( { itemnumber => $item_id3 }, { rows => 1 })->single; $transfer_requested->set({ daterequested => dt_from_string, datesent => undef })->store; @@ -139,7 +143,8 @@ $transfer_requested->set({ daterequested => dt_from_string, datesent => undef }) ModItemTransfer( $item_id4, $branchcode_1, - $branchcode_2 + $branchcode_2, + $trigger ); my $transfer_cancelled = Koha::Item::Transfers->search( { itemnumber => $item_id4 }, { rows => 1 })->single; $transfer_cancelled->set( { daterequested => dt_from_string, datesent => undef, datecancelled => dt_from_string } )->store; @@ -239,13 +244,15 @@ $dbh->do("DELETE FROM branchtransfers"); ModItemTransfer( $item_id1, $branchcode_1, - $branchcode_2 + $branchcode_2, + $trigger ); my $transfer = Koha::Item::Transfers->search()->next(); ModItemTransfer( $item_id1, $branchcode_1, - $branchcode_2 + $branchcode_2, + $trigger ); $transfer->{_result}->discard_changes; ok( $transfer->datearrived, 'Date arrived is set when new transfer is initiated' ); -- 2.20.1