From 5cd2e50861b9c2a04d0c413d23d20cbf27b99987 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 27 Mar 2019 14:47:27 +0000 Subject: [PATCH] Bug 22008: (follow-up) Additional fix for bad test Signed-off-by: Martin Renvoize --- t/db_dependent/Circulation/Returns.t | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/Circulation/Returns.t b/t/db_dependent/Circulation/Returns.t index 88182cdccc..2f09606de5 100644 --- a/t/db_dependent/Circulation/Returns.t +++ b/t/db_dependent/Circulation/Returns.t @@ -39,10 +39,19 @@ use MARC::Field; # Mock userenv, used by AddIssue my $branch; +my $manager_id; my $context = Test::MockModule->new('C4::Context'); -$context->mock( 'userenv', sub { - return { branch => $branch, number => 1234, firstname => "Adam", surname => "Smaith" } -}); +$context->mock( + 'userenv', + sub { + return { + branch => $branch, + number => $manager_id, + firstname => "Adam", + surname => "Smaith" + }; + } +); my $schema = Koha::Database->schema; $schema->storage->txn_begin; @@ -59,6 +68,9 @@ my $rule = Koha::IssuingRule->new( ); $rule->store(); +my $manager = $builder->build({source => 'Borrower'}); +$manager_id = $manager->{borrowernumber}; + subtest "InProcessingToShelvingCart tests" => sub { plan tests => 2; -- 2.20.1