From c52ce558d01fb1f526074dd3e47f0a990b5a19b7 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 18 Jan 2022 11:55:59 +0000 Subject: [PATCH] Bug 29809: (follow-up) Update tests and rename variable Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart Signed-off-by: Fridolin Somers Signed-off-by: Kyle M Hall --- t/db_dependent/StockRotationItems.t | 10 +++++----- tools/stockrotation.pl | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/t/db_dependent/StockRotationItems.t b/t/db_dependent/StockRotationItems.t index fe16023dd8..8c21a3675f 100755 --- a/t/db_dependent/StockRotationItems.t +++ b/t/db_dependent/StockRotationItems.t @@ -267,7 +267,7 @@ subtest "Tests for needs_advancing." => sub { )->store; is($dbitem->needs_advancing, 1, "Ready to be advanced."); $dbtransfer->delete; - warning_is {$dbitem->needs_advancing} "We have no historical branch transfer for itemnumber " . $dbitem->item->itemnumber . "; This should not have happened!", "Missing transfer is warned."; + warning_is {$dbitem->needs_advancing} "We have no historical branch transfer for item " . $dbitem->item->itemnumber . "; This should not have happened!", "Missing transfer is warned."; $schema->storage->txn_rollback; }; @@ -469,13 +469,13 @@ subtest "Tests for advance." => sub { class => 'Koha::Checkouts', value => { branchcode => $srstage_1->branchcode_id, - itemnumber => $sritem_1->itemnumber->itemnumber, + itemnumber => $sritem_1->item->itemnumber, returndate => undef } }); - $sritem_1->itemnumber->holdingbranch($srstage_1->branchcode_id)->store; + $sritem_1->item->holdingbranch($srstage_1->branchcode_id)->store; ok($sritem_1->advance, "Advancement done."); - $transfer_request = $sritem_1->itemnumber->get_transfer; + $transfer_request = $sritem_1->item->get_transfer; is($transfer_request->frombranch, $srstage_1->branchcode_id, "Origin correct."); is($transfer_request->tobranch, $srstage_1->branchcode_id, "Target correct."); is($transfer_request->datesent, undef, "Transfer waiting to initiate until return."); @@ -484,7 +484,7 @@ subtest "Tests for advance." => sub { $sritem_1->advance; #advance back to second stage # Set arrived $transfer_request->datearrived(dt_from_string())->store; - $sritem_1->itemnumber->holdingbranch($srstage_2->branchcode_id)->store; + $sritem_1->item->holdingbranch($srstage_2->branchcode_id)->store; $srstage_1->rota->cyclical(0)->store; # Set Rota to non-cyclical. diff --git a/tools/stockrotation.pl b/tools/stockrotation.pl index 4523c99174..04ff184da5 100755 --- a/tools/stockrotation.pl +++ b/tools/stockrotation.pl @@ -252,7 +252,7 @@ if (!defined $op) { # Get all items on this rota, for each prefetch their # stage and biblio objects - my $items = Koha::StockRotationItems->search( + my $sritems = Koha::StockRotationItems->search( { 'stage.rota_id' => $params{rota_id} }, { prefetch => { -- 2.39.5