Lines 16-22
Link Here
|
16 |
|
16 |
|
17 |
use Modern::Perl; |
17 |
use Modern::Perl; |
18 |
use Data::Dumper qw( Dumper ); |
18 |
use Data::Dumper qw( Dumper ); |
19 |
use Test::More tests => 4; |
19 |
use Test::More tests => 5; |
20 |
|
20 |
|
21 |
use C4::Context; |
21 |
use C4::Context; |
22 |
use C4::Log qw( logaction cronlogaction ); |
22 |
use C4::Log qw( logaction cronlogaction ); |
Lines 90-95
subtest 'logaction(): interface is correctly logged' => sub {
Link Here
|
90 |
is( $log->interface, 'sip', 'Passed interface is respected (sip)'); |
90 |
is( $log->interface, 'sip', 'Passed interface is respected (sip)'); |
91 |
}; |
91 |
}; |
92 |
|
92 |
|
|
|
93 |
subtest 'logaction / trace' => sub { |
94 |
plan tests => 2; |
95 |
|
96 |
C4::Context->interface( 'intranet' ); |
97 |
t::lib::Mocks::mock_preference('ActionLogsTraceDepth',0); |
98 |
|
99 |
logaction( "MEMBERS", "MODIFY", 1, "test1"); |
100 |
is( Koha::ActionLogs->search({ info => 'test1' })->last->trace, undef, 'No trace at level 0' ); |
101 |
t::lib::Mocks::mock_preference('ActionLogsTraceDepth',2); |
102 |
logaction( "MEMBERS", "MODIFY", 1, "test2"); |
103 |
like( Koha::ActionLogs->search({ info => 'test2' })->last->trace, qr/("line":.*){2}/, 'Found two trace levels' ); |
104 |
|
105 |
t::lib::Mocks::mock_preference('ActionLogsTraceDepth',0); |
106 |
}; |
107 |
|
93 |
subtest 'GDPR logging' => sub { |
108 |
subtest 'GDPR logging' => sub { |
94 |
plan tests => 6; |
109 |
plan tests => 6; |
95 |
|
110 |
|
96 |
- |
|
|