From 44f15e07682c36754ad8b5516e328812ddd8611b Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 25 Oct 2022 14:56:23 -0300 Subject: [PATCH] Bug 23012: Fix t/db_dependent/Koha/Item.t With the follow-up changes, the return value is no longer a scalar, but a hashref, but the tests weren't updated accordingly. This patch fixes this situation. To test: 1. Run: $ kshell k$ prove t/db_dependent/Koha/Item.t => FAIL: Tests fail 2. Apply this patch 3. Repeat 1 => SUCCESS: Tests pass! 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/Koha/Item.t | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t index 0f9326e272..cf438e4469 100755 --- a/t/db_dependent/Koha/Item.t +++ b/t/db_dependent/Koha/Item.t @@ -1432,12 +1432,13 @@ subtest 'store() tests' => sub { } ); - my $lostreturn_policy = 'charge'; - my $processingreturn_policy = 'refund'; + my $lostreturn_policy = { + lostreturn => 'charge', + processingreturn => 'refund' + }; my $mocked_circ_rules = Test::MockModule->new('Koha::CirculationRules'); $mocked_circ_rules->mock( 'get_lostreturn_policy', sub { return $lostreturn_policy; } ); - $mocked_circ_rules->mock( 'get_processingreturn_policy', sub { return $processingreturn_policy; } ); # simulate it was found $item->set( { itemlost => 0 } )->store; -- 2.39.5