From 53143d0a131236216b90083ad5094b5647eec037 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 4 Nov 2025 09:13:07 +0100 Subject: [PATCH] Bug 40943: Fix Serials.t We need to mock userenv ERROR: Plugin dateaccessioned.pl: Can't use an undefined value as a HASH reference at /kohadevbox/koha/cataloguing/value_builder/dateaccessioned.pl line 30. --- t/db_dependent/Serials.t | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Serials.t b/t/db_dependent/Serials.t index 1e2e5bbff69..a8ec860ace8 100755 --- a/t/db_dependent/Serials.t +++ b/t/db_dependent/Serials.t @@ -28,6 +28,9 @@ BEGIN { ); } +my $builder = t::lib::TestBuilder->new(); +t::lib::Mocks::mock_userenv( { patron => $builder->build_object( { class => 'Koha::Patrons', } ) } ); + # Auth required for cataloguing plugins my $mAuth = Test::MockModule->new('C4::Auth'); $mAuth->mock( 'check_cookie_auth', sub { return ('ok') } ); @@ -38,8 +41,6 @@ my $dbh = C4::Context->dbh; $dbh->do('DELETE FROM subscription'); -my $builder = t::lib::TestBuilder->new(); - # This could/should be used for all untested methods my @methods = ('updateClaim'); can_ok( 'C4::Serials', @methods ); -- 2.34.1