Bugzilla – Attachment 85712 Details for
Bug 18205
Use Koha::Logger/Log4Perl using Mojolicious app log method
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18205: Unit tests
Bug-18205-Unit-tests.patch (text/plain), 2.66 KB, created by
Josef Moravec
on 2019-02-26 12:16:39 UTC
(
hide
)
Description:
Bug 18205: Unit tests
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2019-02-26 12:16:39 UTC
Size:
2.66 KB
patch
obsolete
>From 5a381eda3f684338645b4406d3b287a8b946ace5 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@jns.fi> >Date: Fri, 3 Mar 2017 16:43:14 +0200 >Subject: [PATCH] Bug 18205: Unit tests > >To test: >1. prove t/db_dependent/Log.t > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > t/db_dependent/Log.t | 19 ++++++++++++++++--- > 1 file changed, 16 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Log.t b/t/db_dependent/Log.t >index dbdf0e2fbf..f96b439d42 100644 >--- a/t/db_dependent/Log.t >+++ b/t/db_dependent/Log.t >@@ -93,7 +93,7 @@ subtest "GetLogs should return all logs if dates are not set" => sub { > > subtest 'logaction(): interface is correctly logged' => sub { > >- plan tests => 4; >+ plan tests => 5; > > # No interface passed, using C4::Context->interface > $dbh->do("DELETE FROM action_logs;"); >@@ -122,11 +122,19 @@ subtest 'logaction(): interface is correctly logged' => sub { > logaction( "MEMBERS", "MODIFY", 1, 'test info', 'sip'); > $logs = GetLogs(); > is( @{$logs}[0]->{ interface }, 'sip', 'Passed interface is respected (sip)'); >+ >+ # Explicit interfaces >+ $dbh->do("DELETE FROM action_logs;"); >+ C4::Context->interface( 'rest' ); >+ logaction( "MEMBERS", "MODIFY", 1, 'test info', 'rest'); >+ $logs = GetLogs(); >+ is( @{$logs}[0]->{ interface }, 'rest', 'Passed interface is respected (rest)'); >+ > }; > > subtest 'GetLogs() respects interface filters' => sub { > >- plan tests => 5; >+ plan tests => 6; > > $dbh->do("DELETE FROM action_logs;"); > >@@ -134,9 +142,10 @@ subtest 'GetLogs() respects interface filters' => sub { > logaction( 'MEMBERS', 'MODIFY', 1, 'sip info', 'sip'); > logaction( 'MEMBERS', 'MODIFY', 1, 'intranet info', 'intranet'); > logaction( 'MEMBERS', 'MODIFY', 1, 'commandline info', 'commandline'); >+ logaction( 'MEMBERS', 'MODIFY', 1, 'rest info', 'rest'); > > my $logs = scalar @{ GetLogs() }; >- is( $logs, 4, 'If no filter on interfaces is passed, all logs are returned'); >+ is( $logs, 5, 'If no filter on interfaces is passed, all logs are returned'); > > $logs = GetLogs(undef,undef,undef,undef,undef,undef,undef,['opac']); > is( @{$logs}[0]->{ interface }, 'opac', 'Interface correctly filtered (opac)'); >@@ -149,6 +158,10 @@ subtest 'GetLogs() respects interface filters' => sub { > > $logs = GetLogs(undef,undef,undef,undef,undef,undef,undef,['commandline']); > is( @{$logs}[0]->{ interface }, 'commandline', 'Interface correctly filtered (commandline)'); >+ >+ $logs = GetLogs(undef,undef,undef,undef,undef,undef,undef,['rest']); >+ is( @{$logs}[0]->{ interface }, 'rest', 'Interface correctly filtered (rest)'); >+ > }; > > $schema->storage->txn_rollback; >-- >2.11.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 18205
:
60848
|
60849
|
60850
|
69226
|
69227
|
69228
|
69232
|
85711
|
85712
|
85713
|
85714
|
87537
|
87538
|
87539
|
87540
|
87541
|
87542
|
87545
|
139811