@@ -, +, @@ --- t/db_dependent/ImportBatch.t | 5 ++++- t/db_dependent/Koha/REST/Plugin/PluginRoutes.t | 10 ++++++++-- t/db_dependent/Koha/Template/Plugin/KohaPlugins.t | 4 +++- 3 files changed, 15 insertions(+), 4 deletions(-) --- a/t/db_dependent/ImportBatch.t +++ a/t/db_dependent/ImportBatch.t @@ -188,7 +188,10 @@ subtest "RecordsFromMarcPlugin" => sub { t::lib::Mocks::mock_config( 'enable_plugins', 1 ); t::lib::Mocks::mock_preference( 'UseKohaPlugins', 1 ); - my ($plugin) = Koha::Plugins->new->GetPlugins({ all => 1, metadata => { name => 'MarcFieldValues' } }); + + my $plugins = Koha::Plugins->new; + $plugins->InstallPlugins; + my ($plugin) = $plugins->GetPlugins({ all => 1, metadata => { name => 'MarcFieldValues' } }); isnt( $plugin, undef, "Plugin found" ); my $records = C4::ImportBatch::RecordsFromMarcPlugin( $name, ref $plugin, 'UTF-8' ); is( @$records, 2, 'Two results returned' ); --- a/t/db_dependent/Koha/REST/Plugin/PluginRoutes.t +++ a/t/db_dependent/Koha/REST/Plugin/PluginRoutes.t @@ -50,7 +50,10 @@ subtest 'Bad plugins tests' => sub { t::lib::Mocks::mock_config( 'enable_plugins', 1 ); t::lib::Mocks::mock_preference( 'UseKohaPlugins', 1 ); - my @plugins = Koha::Plugins->new->GetPlugins( { all => 1 } ); + my $plugins = Koha::Plugins->new; + $plugins->InstallPlugins; + + my @plugins = $plugins->GetPlugins( { all => 1 } ); foreach my $plugin (@plugins) { $plugin->enable; } @@ -81,7 +84,10 @@ subtest 'Disabled plugins tests' => sub { my $good_plugin; - my @plugins = Koha::Plugins->new->GetPlugins( { all => 1 } ); + my $plugins = Koha::Plugins->new; + $plugins->InstallPlugins; + + my @plugins = $plugins->GetPlugins( { all => 1 } ); foreach my $plugin (@plugins) { $plugin->disable; $good_plugin = $plugin --- a/t/db_dependent/Koha/Template/Plugin/KohaPlugins.t +++ a/t/db_dependent/Koha/Template/Plugin/KohaPlugins.t @@ -31,7 +31,9 @@ my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; # Enable all plugins -my @plugins = Koha::Plugins->new->GetPlugins({ all => 1, class => 'Koha::Plugin::Test' }); +my $plugins = Koha::Plugins->new; +$plugins->InstallPlugins; +my @plugins = $plugins->GetPlugins({ all => 1, class => 'Koha::Plugin::Test' }); map { $_->enable; } @plugins; my $mock_plugin = Test::MockModule->new( 'Koha::Plugin::Test' ); --