Bugzilla – Attachment 173617 Details for
Bug 37872
ILL module has issues when plugins are disabled (enable_plugins = 0)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37872: Add tests
Bug-37872-Add-tests.patch (text/plain), 2.44 KB, created by
Pedro Amorim
on 2024-10-29 11:24:04 UTC
(
hide
)
Description:
Bug 37872: Add tests
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-10-29 11:24:04 UTC
Size:
2.44 KB
patch
obsolete
>From 3b5d0dfb9ff338a0c39c16adbd83dc9e8f31aae5 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Tue, 29 Oct 2024 11:12:25 +0000 >Subject: [PATCH] Bug 37872: Add tests > >$ prove t/db_dependent/Koha/ILL/Request.t >$ prove t/db_dependent/Koha/ILL/Request/Config.t > >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >--- > t/db_dependent/Koha/ILL/Request.t | 19 ++++++++++++++++++- > t/db_dependent/Koha/ILL/Request/Config.t | 17 ++++++++++++++++- > 2 files changed, 34 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/ILL/Request.t b/t/db_dependent/Koha/ILL/Request.t >index 2ec832949e..fe8f1631c9 100755 >--- a/t/db_dependent/Koha/ILL/Request.t >+++ b/t/db_dependent/Koha/ILL/Request.t >@@ -19,11 +19,12 @@ > > use Modern::Perl; > >-use Test::More tests => 3; >+use Test::More tests => 4; > use Test::MockModule; > > use Koha::ILL::Requests; > >+use t::lib::Mocks; > use t::lib::TestBuilder; > > my $builder = t::lib::TestBuilder->new; >@@ -130,3 +131,19 @@ subtest 'get_type_disclaimer_date() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'get_backend_plugin() tests' => sub { >+ >+ plan tests => 1; >+ >+ $schema->storage->txn_begin; >+ >+ my $request = $builder->build_object( { class => 'Koha::ILL::Requests' } ); >+ t::lib::Mocks::mock_config( 'enable_plugins', 0 ); >+ is( >+ $request->get_backend_plugin, undef, >+ 'get_backend_plugin returns undef if plugins are disabled' >+ ); >+ >+ $schema->storage->txn_rollback; >+}; >diff --git a/t/db_dependent/Koha/ILL/Request/Config.t b/t/db_dependent/Koha/ILL/Request/Config.t >index f511726c30..2d4b60f260 100755 >--- a/t/db_dependent/Koha/ILL/Request/Config.t >+++ b/t/db_dependent/Koha/ILL/Request/Config.t >@@ -23,7 +23,7 @@ use t::lib::TestBuilder; > use Test::MockObject; > use Test::Exception; > >-use Test::More tests => 5; >+use Test::More tests => 6; > > my $schema = Koha::Database->new->schema; > my $builder = t::lib::TestBuilder->new; >@@ -487,5 +487,20 @@ subtest 'Final tests' => sub { > $schema->storage->txn_rollback; > }; > >+subtest 'get_backend_plugin_names() tests' => sub { >+ >+ plan tests => 1; >+ >+ $schema->storage->txn_begin; >+ >+ my $config = Koha::ILL::Request::Config->new; >+ t::lib::Mocks::mock_config( 'enable_plugins', 0 ); >+ is( >+ $config->get_backend_plugin_names(), 0, >+ 'get_backend_plugin_names returns empty list if plugins are disabled' >+ ); >+ >+ $schema->storage->txn_rollback; >+}; > > 1; >-- >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 37872
:
171227
|
171237
|
173617
|
173618
|
173619
|
173727
|
173728
|
173729
|
173771
|
173772
|
173773