Bugzilla – Attachment 175826 Details for
Bug 38761
Backend plugins that are disabled remain visible
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38761: Add tests
Bug-38761-Add-tests.patch (text/plain), 2.71 KB, created by
Pedro Amorim
on 2024-12-20 12:07:14 UTC
(
hide
)
Description:
Bug 38761: Add tests
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-12-20 12:07:14 UTC
Size:
2.71 KB
patch
obsolete
>From 92dc9cd56c5149e7352b3e201301fb97478eb0f4 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Fri, 20 Dec 2024 12:00:33 +0000 >Subject: [PATCH] Bug 38761: Add tests > >prove t/db_dependent/Koha/ILL/Request/Config.t >--- > t/db_dependent/Koha/ILL/Request/Config.t | 45 ++++++++++++++++++++++-- > 1 file changed, 43 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/ILL/Request/Config.t b/t/db_dependent/Koha/ILL/Request/Config.t >index 2d4b60f2609..e42e585a606 100755 >--- a/t/db_dependent/Koha/ILL/Request/Config.t >+++ b/t/db_dependent/Koha/ILL/Request/Config.t >@@ -16,6 +16,8 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+use File::Basename; >+use File::Path qw(make_path remove_tree); > > use Koha::Database; > use t::lib::Mocks; >@@ -23,7 +25,17 @@ use t::lib::TestBuilder; > use Test::MockObject; > use Test::Exception; > >-use Test::More tests => 6; >+use Test::More tests => 9; >+ >+BEGIN { >+ # Mock pluginsdir before loading Plugins module >+ my $path = dirname(__FILE__) . '/../../../../lib/plugins'; >+ t::lib::Mocks::mock_config( 'pluginsdir', $path ); >+ >+ use_ok('Koha::Plugins'); >+ use_ok('Koha::Plugins::Handler'); >+ use_ok('Koha::Plugin::Test'); >+} > > my $schema = Koha::Database->new->schema; > my $builder = t::lib::TestBuilder->new; >@@ -489,7 +501,7 @@ subtest 'Final tests' => sub { > > subtest 'get_backend_plugin_names() tests' => sub { > >- plan tests => 1; >+ plan tests => 3; > > $schema->storage->txn_begin; > >@@ -500,6 +512,35 @@ subtest 'get_backend_plugin_names() tests' => sub { > 'get_backend_plugin_names returns empty list if plugins are disabled' > ); > >+ t::lib::Mocks::mock_config( 'enable_plugins', 1 ); >+ my $koha_plugins = Koha::Plugins->new(); >+ $koha_plugins->InstallPlugins; >+ >+ my @backend_plugins = >+ $koha_plugins >+ ? $koha_plugins->GetPlugins( { plugin_class => 'Koha::Plugin::Test' } ) >+ : (); >+ my $backend_plugin = $backend_plugins[0]; >+ >+ my @backend_plugin_names = $config->get_backend_plugin_names(); >+ my $backend_plugin_name = $backend_plugin_names[0]; >+ >+ is( >+ $backend_plugin_name, $backend_plugin->get_metadata()->{name}, >+ 'get_backend_plugin_names returns list of backend plugin names' >+ ); >+ >+ $backend_plugin->disable; >+ my @after_disable_backend_plugin_names = $config->get_backend_plugin_names(); >+ my $after_disable_backend_plugin_name = $after_disable_backend_plugin_names[0]; >+ >+ is( >+ $after_disable_backend_plugin_name, undef, >+ 'get_backend_plugin_names returns empty list if backend plugin is disabled' >+ ); >+ >+ #cleanup >+ Koha::Plugins::Methods->delete; > $schema->storage->txn_rollback; > }; > >-- >2.39.5
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 38761
:
175824
|
175825
|
175826
|
175827
|
175931
|
175932
|
176271
|
176272