Bugzilla – Attachment 88783 Details for
Bug 22053
Ability to disable some plugins
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 22053: create unit tests
SIGNED-OFF-Bug-22053-create-unit-tests.patch (text/plain), 2.39 KB, created by
Claire Gravely
on 2019-04-25 14:32:54 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 22053: create unit tests
Filename:
MIME Type:
Creator:
Claire Gravely
Created:
2019-04-25 14:32:54 UTC
Size:
2.39 KB
patch
obsolete
>From 0b6a2124123c0b77637c2dda76c9b23070acc818 Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Fri, 28 Dec 2018 17:48:43 +0100 >Subject: [PATCH] [SIGNED-OFF] Bug 22053: create unit tests > >Rebased-on: 2019-03-25 Alex Arnaud <alex.arnaud@biblibre.com> > >Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> >--- > t/db_dependent/Plugins.t | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Plugins.t b/t/db_dependent/Plugins.t >index 7bbd8d9..f34500e 100755 >--- a/t/db_dependent/Plugins.t >+++ b/t/db_dependent/Plugins.t >@@ -9,7 +9,7 @@ use File::Temp qw( tempdir tempfile ); > use FindBin qw($Bin); > use Module::Load::Conditional qw(can_load); > use Test::MockModule; >-use Test::More tests => 42; >+use Test::More tests => 44; > > use C4::Context; > use Koha::Database; >@@ -77,15 +77,19 @@ close $fh; > my $classname = ref($plugin); > like( $plugin->test_template($fn), qr/^I am $fn/, 'Template works' ); > >+$plugin->enable; >+ > # testing GetPlugins > my @plugins = Koha::Plugins->new({ enable_plugins => 1 })->GetPlugins({ > method => 'report' > }); >+ > my @names = map { $_->get_metadata()->{'name'} } @plugins; > is( scalar grep( /^Test Plugin$/, @names), 1, "Koha::Plugins::GetPlugins functions correctly" ); > @plugins = Koha::Plugins->new({ enable_plugins => 1 })->GetPlugins({ > metadata => { my_example_tag => 'find_me' }, > }); >+ > @names = map { $_->get_metadata()->{'name'} } @plugins; > is( scalar grep( /^Test Plugin$/, @names), 1, "GetPlugins also found Test Plugin via a metadata tag" ); > # Test two metadata conditions; one does not exist for Test.pm >@@ -95,6 +99,16 @@ my @plugins2 = Koha::Plugins->new({ enable_plugins => 1 })->GetPlugins({ > }); > isnt( scalar @plugins2, scalar @plugins, 'GetPlugins with two metadata conditions' ); > >+$plugin->disable; >+ >+@plugins = Koha::Plugins->new({ enable_plugins => 1 })->GetPlugins(); >+@names = map { $_->get_metadata()->{'name'} } @plugins; >+is( scalar grep( /^Test Plugin$/, @names), 0, "GetPlugins does not found disabled Test Plugin" ); >+ >+@plugins = Koha::Plugins->new({ enable_plugins => 1 })->GetPlugins({ all => 1 }); >+@names = map { $_->get_metadata()->{'name'} } @plugins; >+is( scalar grep( /^Test Plugin$/, @names), 1, "With all param, GetPlugins found disabled Test Plugin" ); >+ > for my $pass ( 1 .. 2 ) { > my $plugins_dir; > my $module_name = 'Koha::Plugin::Com::ByWaterSolutions::KitchenSink'; >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22053
:
83537
|
83538
|
83539
|
83540
|
83666
|
83667
|
86961
|
86962
|
86963
|
86964
|
88783
|
88784
|
88785
|
88818
|
88819
|
88820
|
89040
|
89041
|
89042
|
89043
|
89116
|
89551
|
89558