From 5a637617e497cbf30b7c33a3a93d52117773e997 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 19 Apr 2022 08:30:56 +0100 Subject: [PATCH] Bug 30410: (follow-up) Instantiate object in unit test This patch updates the unit test for the BackgroundJob->_derived_class() private method to instantiate a proper object to work on instead of calling the type_to_class_mapping method directly as non-object method. Signed-off-by: Martin Renvoize --- t/db_dependent/Koha/BackgroundJob.t | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha/BackgroundJob.t b/t/db_dependent/Koha/BackgroundJob.t index 632a615483..04e78f956f 100755 --- a/t/db_dependent/Koha/BackgroundJob.t +++ b/t/db_dependent/Koha/BackgroundJob.t @@ -35,7 +35,8 @@ subtest '_derived_class() tests' => sub { $schema->storage->txn_begin; - my $mapping = Koha::BackgroundJob::type_to_class_mapping; + my $job_object = Koha::BackgroundJob->new(); + my $mapping = $job_object->type_to_class_mapping; # pick the first my $type = ( keys %{$mapping} )[0];