From 838519129369efc6e50f6ca363ed9c94b811e87b Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 15 Mar 2021 16:41:41 +0000 Subject: [PATCH] Bug 24295: Replace mock in t/db_dependent/Circulation/transferbook.t Replace the call to GetTransfers with the get_transfer method in Koha::Item in transferbook.t Test plan 1/ Run t/db_dependent/Circulation/transferbook.t 2/ Confirm it passes 3/ Apply patch 4/ Repeat steps 1-2 --- t/db_dependent/Circulation/transferbook.t | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/t/db_dependent/Circulation/transferbook.t b/t/db_dependent/Circulation/transferbook.t index 03c735afbd..bc142cf9ed 100755 --- a/t/db_dependent/Circulation/transferbook.t +++ b/t/db_dependent/Circulation/transferbook.t @@ -291,17 +291,17 @@ subtest 'transferbook test from branch' => sub { barcode => $item->barcode, trigger => "Manual" }); - my ($datesent,$from_branch,$to_branch) = GetTransfers($item->itemnumber); - is( $from_branch, $library->branchcode, 'The transfer is initiated from the specified branch, not the items home or holdingbranch'); - is( $to_branch, $item->homebranch, 'The transfer is initiated to the specified branch'); + my $transfer = $item->get_transfer; + is( $transfer->frombranch, $library->branchcode, 'The transfer is initiated from the specified branch, not the items home or holdingbranch'); + is( $transfer->tobranch, $item->homebranch, 'The transfer is initiated to the specified branch'); C4::Circulation::transferbook({ from_branch => $item->homebranch, to_branch => $library->branchcode, barcode => $item->barcode, trigger => "Manual" }); - ($datesent,$from_branch,$to_branch) = GetTransfers($item->itemnumber); - is( $from_branch, $item->homebranch, 'The transfer is initiated from the specified branch'); - is( $to_branch, $library->branchcode, 'The transfer is initiated to the specified branch'); + $transfer = $item->get_transfer; + is( $transfer->frombranch, $item->homebranch, 'The transfer is initiated from the specified branch'); + is( $transfer->tobranch, $library->branchcode, 'The transfer is initiated to the specified branch'); }; -- 2.20.1