Bugzilla – Attachment 60849 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.54 KB, created by
Lari Taskula
on 2017-03-06 18:05:38 UTC
(
hide
)
Description:
Bug 18205: Unit tests
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2017-03-06 18:05:38 UTC
Size:
2.54 KB
patch
obsolete
>From 6b36be55eb033f25ae65b1b361b5f0dbbd9a6532 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 >--- > t/db_dependent/Log.t | 17 ++++++++++++++--- > 1 file changed, 14 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Log.t b/t/db_dependent/Log.t >index 3d878bd..10e465d 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;"); >@@ -123,12 +123,19 @@ subtest 'logaction(): interface is correctly logged' => sub { > $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)'); >+ > $dbh->rollback; > }; > > subtest 'GetLogs() respects interface filters' => sub { > >- plan tests => 5; >+ plan tests => 6; > > $dbh->do("DELETE FROM action_logs;"); > >@@ -136,9 +143,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)'); >@@ -152,6 +160,9 @@ 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)'); >+ > $dbh->rollback; > }; > >-- >1.9.1
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