From: Marcel de Rooy <m.de.r...@rijksmuseum.nl>

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 <srd...@catalyst.net.nz>
---
 t/db_dependent/Plugins.t | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/t/db_dependent/Plugins.t b/t/db_dependent/Plugins.t
index 308e215..73ce65b 100755
--- a/t/db_dependent/Plugins.t
+++ b/t/db_dependent/Plugins.t
@@ -43,7 +43,8 @@ ok( $plugin->get_qualified_table_name('mytable') eq 
'koha_plugin_test_mytable',
 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");
-- 
2.7.4
_______________________________________________
Koha-patches mailing list
Koha-patches@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to