Bugzilla – Attachment 173727 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.48 KB, created by
David Nind
on 2024-10-30 16:59:34 UTC
(
hide
)
Description:
Bug 37872: Add tests
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-10-30 16:59:34 UTC
Size:
2.48 KB
patch
obsolete
>From de9ea07ecdceb5e9b2dfc310e5ff1a167b2e49bd 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> >Signed-off-by: David Nind <david@davidnind.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