Lines 8-13
use Modern::Perl;
Link Here
|
8 |
use Test::More tests => 10; |
8 |
use Test::More tests => 10; |
9 |
|
9 |
|
10 |
use C4::Context; |
10 |
use C4::Context; |
|
|
11 |
use Koha::Database; |
11 |
use Koha::DateUtils; |
12 |
use Koha::DateUtils; |
12 |
|
13 |
|
13 |
use t::lib::Mocks qw/mock_preference/; # to mock CronjobLog |
14 |
use t::lib::Mocks qw/mock_preference/; # to mock CronjobLog |
Lines 20-28
BEGIN {
Link Here
|
20 |
my $success; |
21 |
my $success; |
21 |
|
22 |
|
22 |
# Make sure we can rollback. |
23 |
# Make sure we can rollback. |
|
|
24 |
my $schema = Koha::Database->new->schema; |
25 |
$schema->storage->txn_begin; |
23 |
my $dbh = C4::Context->dbh; |
26 |
my $dbh = C4::Context->dbh; |
24 |
$dbh->{AutoCommit} = 0; |
|
|
25 |
$dbh->{RaiseError} = 1; |
26 |
|
27 |
|
27 |
eval { |
28 |
eval { |
28 |
# FIXME: are we sure there is an member number 1? |
29 |
# FIXME: are we sure there is an member number 1? |
Lines 121-128
subtest 'logaction(): interface is correctly logged' => sub {
Link Here
|
121 |
logaction( "MEMBERS", "MODIFY", 1, 'test info', 'sip'); |
122 |
logaction( "MEMBERS", "MODIFY", 1, 'test info', 'sip'); |
122 |
$logs = GetLogs(); |
123 |
$logs = GetLogs(); |
123 |
is( @{$logs}[0]->{ interface }, 'sip', 'Passed interface is respected (sip)'); |
124 |
is( @{$logs}[0]->{ interface }, 'sip', 'Passed interface is respected (sip)'); |
124 |
|
|
|
125 |
$dbh->rollback; |
126 |
}; |
125 |
}; |
127 |
|
126 |
|
128 |
subtest 'GetLogs() respects interface filters' => sub { |
127 |
subtest 'GetLogs() respects interface filters' => sub { |
Lines 150-157
subtest 'GetLogs() respects interface filters' => sub {
Link Here
|
150 |
|
149 |
|
151 |
$logs = GetLogs(undef,undef,undef,undef,undef,undef,undef,['commandline']); |
150 |
$logs = GetLogs(undef,undef,undef,undef,undef,undef,undef,['commandline']); |
152 |
is( @{$logs}[0]->{ interface }, 'commandline', 'Interface correctly filtered (commandline)'); |
151 |
is( @{$logs}[0]->{ interface }, 'commandline', 'Interface correctly filtered (commandline)'); |
153 |
|
|
|
154 |
$dbh->rollback; |
155 |
}; |
152 |
}; |
156 |
|
153 |
|
157 |
$dbh->rollback; |
154 |
$schema->storage->txn_rollback; |
158 |
- |
|
|