From 75ad4cf499ef7d1cf081cb1e18d28c8ccb632e60 Mon Sep 17 00:00:00 2001
From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Date: Fri, 25 Oct 2019 09:04:25 +0000
Subject: [PATCH] Bug 23896: Add unit tests
Content-Type: text/plain; charset=utf-8
Test plan:
Run t/db_dependent/Log.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
---
t/db_dependent/Log.t | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/t/db_dependent/Log.t b/t/db_dependent/Log.t
index f84fb14265..d3bb83750d 100644
--- a/t/db_dependent/Log.t
+++ b/t/db_dependent/Log.t
@@ -17,7 +17,7 @@
# with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
-use Test::More tests => 5;
+use Test::More tests => 6;
use C4::Context;
use C4::Log;
@@ -163,6 +163,18 @@ subtest 'GetLogs() respects interface filters' => sub {
is( @{$logs}[0]->{ interface }, 'commandline', 'Interface correctly filtered (commandline)');
};
+subtest 'Check interface for logaction' => sub {
+ plan tests => 2;
+
+ C4::Context->interface('opac');
+ logaction( 'NEWMODULE', 'ACTIONX', 0, '', 'my_interface');
+ logaction( 'NEWMODULE', 'ACTIONX', 0, '' ); # default interface
+ my $logs = GetLogs( undef, undef, undef, ['NEWMODULE'], undef, undef, undef, [ 'my_interface' ] );
+ is( @$logs, 1, 'Found my_interface' );
+ $logs = GetLogs( undef, undef, undef, ['NEWMODULE'], undef, undef, undef, [ 'opac' ] );
+ is( @$logs, 1, 'Found opac' );
+};
+
subtest 'GDPR logging' => sub {
plan tests => 1;
--
2.11.0