Bugzilla – Attachment 146728 Details for
Bug 32979
Add Test::Exception to Logger.t
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32979: Add Test::Exception to Logger.t
Bug-32979-Add-TestException-to-Loggert.patch (text/plain), 1.68 KB, created by
Marcel de Rooy
on 2023-02-16 12:47:12 UTC
(
hide
)
Description:
Bug 32979: Add Test::Exception to Logger.t
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-02-16 12:47:12 UTC
Size:
1.68 KB
patch
obsolete
>From 633928cb1ca60d67ff223699cea5fceb9da60074 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 26 Jan 2023 15:08:24 +0000 >Subject: [PATCH] Bug 32979: Add Test::Exception to Logger.t >Content-Type: text/plain; charset=utf-8 > >Test plan: >Run t/Logger.t >Note: Run under koha user, not root. Root wont have >the permission failure which is tested. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/Logger.t | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > >diff --git a/t/Logger.t b/t/Logger.t >index 870ecd9029..b51acd2aea 100755 >--- a/t/Logger.t >+++ b/t/Logger.t >@@ -24,6 +24,7 @@ use t::lib::Mocks; > use File::Temp qw/tempfile/; > use Test::More tests => 1; > use Test::Warn; >+use Test::Exception; > > subtest 'Test01 -- Simple tests for Koha::Logger' => sub { > plan tests => 10; >@@ -31,8 +32,7 @@ subtest 'Test01 -- Simple tests for Koha::Logger' => sub { > my $ret; > t::lib::Mocks::mock_config('log4perl_conf', undef); > >- eval { Koha::Logger->get }; >- ok( $@, 'Logger did not init correctly without config'); >+ throws_ok { Koha::Logger->get } qr/Configuration not defined/, 'Logger did not init correctly without config'; > > my $log = mytempfile(); > my $config_file = mytempfile( <<"HERE" >@@ -48,8 +48,7 @@ HERE > t::lib::Mocks::mock_config('log4perl_conf', $config_file); > > system("chmod 400 $log"); >- eval { Koha::Logger->get }; >- ok( $@, 'Logger did not init correctly without permission'); >+ throws_ok { Koha::Logger->get } qr/Permission denied/, 'Logger did not init correctly without permission'; > > system("chmod 700 $log"); > my $logger = Koha::Logger->get( { interface => 'intranet' } ); >-- >2.30.2
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 32979
:
146727
|
146728
|
146844
|
146845