From 1a2ee03ca82137e9c593e3cb0415085cb6653975 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 (cherry picked from commit c52ce558d01fb1f526074dd3e47f0a990b5a19b7) Signed-off-by: Andrew Fuerste-Henry --- 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 64448e60cf..190ebcf248 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 b1755635b4..79425adbbb 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