From 1cefa1e5af735b2cbdcb04b791d4cb8d397cde19 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 19 Nov 2019 09:40:07 +0100 Subject: [PATCH] Bug 24062: Fix the failing test Content-Type: text/plain; charset=utf-8 Signed-off-by: Martin Renvoize Signed-off-by: Marcel de Rooy --- t/db_dependent/Circulation.t | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index e35b59fe51..aff4ee918e 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -1955,34 +1955,31 @@ subtest 'AddReturn + suspension_chargeperiod' => sub { subtest 'CanBookBeIssued + AutoReturnCheckedOutItems' => sub { plan tests => 2; - my $library = $builder->build( { source => 'Branch' } ); + my $library = $builder->build_object( { class => 'Koha::Libraries' } ); my $patron1 = $builder->build_object( { class => 'Koha::Patrons', - value => { - branchcode => $library->{branchcode}, - firstname => "Happy", - surname => "Gilmore", + value => { + library => $library->branchcode, + categorycode => $patron_category->{categorycode} } } ); my $patron2 = $builder->build_object( { class => 'Koha::Patrons', - value => { - branchcode => $library->{branchcode}, - firstname => "Billy", - surname => "Madison", + value => { + library => $library->branchcode, + categorycode => $patron_category->{categorycode} } } ); - C4::Context->_new_userenv('xxx'); - C4::Context->set_userenv(0,0,0,'firstname','surname', $library->{branchcode}, 'Random Library', '', '', ''); + t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode }); my $item = $builder->build_sample_item( { - library => $library->{branchcode}, + library => $library->branchcode, } )->unblessed; -- 2.11.0