Bugzilla – Attachment 90631 Details for
Bug 21073
Improve plugin performance
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21073: (QA follow-up) Only public subs should be considered
Bug-21073-QA-follow-up-Only-public-subs-should-be-.patch (text/plain), 2.44 KB, created by
Tomás Cohen Arazi (tcohen)
on 2019-06-14 19:51:33 UTC
(
hide
)
Description:
Bug 21073: (QA follow-up) Only public subs should be considered
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2019-06-14 19:51:33 UTC
Size:
2.44 KB
patch
obsolete
>From ca7f2386eb91ead82e6df9974101bc8a1bd29454 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 14 Jun 2019 16:51:07 -0300 >Subject: [PATCH] Bug 21073: (QA follow-up) Only public subs should be > considered > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Plugins.pm | 2 +- > t/db_dependent/Plugins.t | 5 +++-- > t/lib/Koha/Plugin/Test.pm | 4 ++++ > 3 files changed, 8 insertions(+), 3 deletions(-) > >diff --git a/Koha/Plugins.pm b/Koha/Plugins.pm >index 768a5678d8..be1d091631 100644 >--- a/Koha/Plugins.pm >+++ b/Koha/Plugins.pm >@@ -136,7 +136,7 @@ sub InstallPlugins { > > Koha::Plugins::Methods->search({ plugin_class => $plugin_class })->delete(); > >- foreach my $method ( @{ Class::Inspector->methods($plugin_class) } ) { >+ foreach my $method ( @{ Class::Inspector->methods( $plugin_class, 'public' ) } ) { > Koha::Plugins::Method->new( > { > plugin_class => $plugin_class, >diff --git a/t/db_dependent/Plugins.t b/t/db_dependent/Plugins.t >index c72f27d683..53ae26e06e 100755 >--- a/t/db_dependent/Plugins.t >+++ b/t/db_dependent/Plugins.t >@@ -23,7 +23,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 => 49; >+use Test::More tests => 50; > > use C4::Context; > use Koha::Database; >@@ -115,6 +115,7 @@ Koha::Plugins::Methods->delete; > Koha::Plugins->new( { enable_plugins => 1 } )->InstallPlugins(); > > ok( Koha::Plugins::Methods->search( { plugin_class => 'Koha::Plugin::Test' } )->count, 'Test plugin methods added to database' ); >+is( Koha::Plugins::Methods->search({ plugin_class => 'Koha::Plugin::Test', plugin_method => '_private_sub' })->count, 0, 'Private methods are skipped' ); > > my $mock_plugin = Test::MockModule->new( 'Koha::Plugin::Test' ); > $mock_plugin->mock( 'test_template', sub { >@@ -286,4 +287,4 @@ subtest 'new() tests' => sub { > is( ref($result), 'Koha::Plugins', 'calling new with enable_plugins makes it override the config' ); > }; > >-$schema->storage->txn_rollback; >\ No newline at end of file >+$schema->storage->txn_rollback; >diff --git a/t/lib/Koha/Plugin/Test.pm b/t/lib/Koha/Plugin/Test.pm >index 2cb749e7dd..764b5a6b2b 100644 >--- a/t/lib/Koha/Plugin/Test.pm >+++ b/t/lib/Koha/Plugin/Test.pm >@@ -182,3 +182,7 @@ sub api_routes { > > return decode_json($spec); > } >+ >+sub _private_sub { >+ return ""; >+} >-- >2.22.0
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 21073
:
76955
|
76956
|
76957
|
76958
|
76973
|
88379
|
88380
|
88381
|
89247
|
89251
|
89252
|
89255
|
89256
|
89272
|
89273
|
89274
|
89275
|
89276
|
89277
|
89278
|
89279
|
89786
|
89800
|
89801
|
89802
|
89803
|
89804
|
89805
|
89806
|
89807
|
89808
|
90630
|
90631
|
90650
|
90651
|
90652
|
90653
|
90654
|
90655
|
90656
|
90657
|
90658
|
90659
|
90660
|
90661
|
90662
|
90663
|
90664
|
90724
|
90725
|
90726
|
90727
|
90728
|
90729
|
90730
|
90731
|
90732
|
90733
|
90734
|
90735
|
90736
|
90737
|
90738
|
90739
|
90759
|
90816