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 <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Martin Renvoize 2022-04-19 08:30:56 +01:00
parent c2f2153780
commit 5a637617e4
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

View file

@ -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];