From bbf1c8eaca78a0a450564a68726d193ea58112c4 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Tue, 24 Dec 2024 10:38:08 +0000 Subject: [PATCH] Bug 38782: Mock userenv->{number} prove t/db_dependent/Koha/BackgroundJobs/ErmSushiHarvester.t Signed-off-by: Tomas Cohen Arazi Edit: tidy (tcohen) --- t/db_dependent/Koha/BackgroundJobs/ErmSushiHarvester.t | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha/BackgroundJobs/ErmSushiHarvester.t b/t/db_dependent/Koha/BackgroundJobs/ErmSushiHarvester.t index ace123e7d4b..f819e5d9957 100755 --- a/t/db_dependent/Koha/BackgroundJobs/ErmSushiHarvester.t +++ b/t/db_dependent/Koha/BackgroundJobs/ErmSushiHarvester.t @@ -23,7 +23,7 @@ use Koha::Database; use Koha::BackgroundJobs; use Koha::BackgroundJob::ErmSushiHarvester; -use JSON qw( decode_json ); +use JSON qw( decode_json ); use File::Basename qw( dirname ); use File::Slurp; @@ -86,6 +86,9 @@ subtest 'enqueue_sushi_harvest_jobs' => sub { $schema->storage->txn_begin; + my $patron = Koha::Patrons->search()->last; + t::lib::Mocks::mock_userenv( { number => $patron->borrowernumber } ); # Is superlibrarian + my $usage_data_provider = $builder->build_object( { class => 'Koha::ERM::EUsage::UsageDataProviders', value => { name => 'TestProvider' } } ); -- 2.47.1