From c8fc8c2baa6b70559e1b2849a34a36967f7ee430 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 29 Apr 2020 19:12:09 -0300 Subject: [PATCH] Bug 25131: Make sure plugin data is fresh Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/Koha/REST/Plugin/PluginRoutes.t | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/t/db_dependent/Koha/REST/Plugin/PluginRoutes.t b/t/db_dependent/Koha/REST/Plugin/PluginRoutes.t index d722707bc4..75a2f66a86 100644 --- a/t/db_dependent/Koha/REST/Plugin/PluginRoutes.t +++ b/t/db_dependent/Koha/REST/Plugin/PluginRoutes.t @@ -132,15 +132,10 @@ subtest 'needs_install use case tests' => sub { my $plugins = Koha::Plugins->new; $plugins->InstallPlugins; - my @plugins = $plugins->GetPlugins( { all => 1 } ); - foreach my $plugin (@plugins) { - $good_plugin = $plugin - if $plugin->{metadata}->{description} eq 'Test plugin'; - } - # mock Version before initializing the API class t::lib::Mocks::mock_preference('Version', undef); # initialize Koha::REST::V1 after mocking + my $t = Test::Mojo->new('Koha::REST::V1'); my $routes = get_defined_routes($t); @@ -153,6 +148,10 @@ subtest 'needs_install use case tests' => sub { ); t::lib::Mocks::mock_preference('Version', '3.0.0'); + + $schema->resultset('PluginData')->delete; + $plugins->InstallPlugins; + # re-initialize Koha::REST::V1 after mocking $t = Test::Mojo->new('Koha::REST::V1'); $routes = get_defined_routes($t); -- 2.26.2