From e6b80fe8b95c564d2903046a0607aa6c96b4f610 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Mon, 25 Mar 2024 11:56:15 +0000 Subject: [PATCH] Bug 35536: (follow-up) Fix Plugins.t for D10 Content-Type: text/plain; charset=utf-8 Signed-off-by: Marcel de Rooy --- t/db_dependent/Koha/Plugins/Plugins.t | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/Koha/Plugins/Plugins.t b/t/db_dependent/Koha/Plugins/Plugins.t index 1dcd8578b1..1c8f96ab15 100755 --- a/t/db_dependent/Koha/Plugins/Plugins.t +++ b/t/db_dependent/Koha/Plugins/Plugins.t @@ -333,13 +333,16 @@ subtest 'RemovePlugins' => sub { Koha::Plugins::Method->new( { plugin_class => "$class_basename$i", plugin_method => "testmr$i" } )->store; # no_auto => 1 here prevents loading of a not-existing module - $mocks->[$i] = Test::MockModule->new( "$class_basename$i", no_auto => 1 )->mock( new => 1 ) - unless $mocks->[$i]; + unless ( $mocks->[$i] ) { + $mocks->[$i] = Test::MockModule->new( "$class_basename$i", no_auto => 1 ); + $mocks->[$i]->mock( new => 1 ); + } } # We will (re)create new plugins (without modules) # This requires mocking can_load from Module::Load::Conditional - my $mlc_mock = Test::MockModule->new('Koha::Plugins')->mock( can_load => 1 ); + my $mlc_mock = Test::MockModule->new('Koha::Plugins'); + $mlc_mock->mock( can_load => 1 ); my $plugin_mocks = []; my @enabled_plugins; -- 2.30.2