The current test assumes that GetPlugins will return the test plugin
as the first one in the array. This is not correct.
This patch adjusts the test to a grep.
Test plan:
Run the test.
Bonus: Add additional plugins. Run the test again.
Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit
6ad5770786c6646ce68ffdfec9080645fc25772e)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit
64382be0d45ad6d43bb86bda095ca1a3699d1265)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
(cherry picked from commit
d1dff4c3bde88c2b7c2bb6722ef07d1fcf5f5cce)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
ok( $plugin->get_plugin_http_path() eq '/plugin/Koha/Plugin/Test', 'Test $plugin->get_plugin_http_path()' );
my @plugins = Koha::Plugins->new({ enable_plugins => 1 })->GetPlugins( 'report' );
-ok( $plugins[0]->get_metadata()->{'name'} eq 'Test Plugin', "Koha::Plugins::GetPlugins functions correctly" );
+my @names = map { $_->get_metadata()->{'name'} } @plugins;
+is( scalar grep( /^Test Plugin$/, @names), 1, "Koha::Plugins::GetPlugins functions correctly" );
SKIP: {
my $plugins_dir = C4::Context->config("pluginsdir");