Lines 22-27
use Test::More tests => 3;
Link Here
|
22 |
use C4::Context; |
22 |
use C4::Context; |
23 |
use C4::Log; |
23 |
use C4::Log; |
24 |
use Koha::Database; |
24 |
use Koha::Database; |
|
|
25 |
use Koha::DateUtils qw( dt_from_string ); |
25 |
|
26 |
|
26 |
use t::lib::TestBuilder; |
27 |
use t::lib::TestBuilder; |
27 |
|
28 |
|
Lines 33-39
my $schema = Koha::Database->new->schema;
Link Here
|
33 |
my $builder = t::lib::TestBuilder->new; |
34 |
my $builder = t::lib::TestBuilder->new; |
34 |
|
35 |
|
35 |
subtest 'store() tests' => sub { |
36 |
subtest 'store() tests' => sub { |
36 |
plan tests => 2; |
37 |
plan tests => 3; |
37 |
|
38 |
|
38 |
$schema->storage->txn_begin; |
39 |
$schema->storage->txn_begin; |
39 |
|
40 |
|
Lines 48-53
subtest 'store() tests' => sub {
Link Here
|
48 |
is( ref($log), 'Koha::ActionLog', 'Log object creation success'); |
49 |
is( ref($log), 'Koha::ActionLog', 'Log object creation success'); |
49 |
is( Koha::ActionLogs->count, $logs_count + 1, 'Exactly one log was saved'); |
50 |
is( Koha::ActionLogs->count, $logs_count + 1, 'Exactly one log was saved'); |
50 |
|
51 |
|
|
|
52 |
my $yesterday = dt_from_string->subtract( days => 1 ); |
53 |
$log->timestamp($yesterday)->store; |
54 |
$log->info("a new info")->store; # Must be 2 different store calls |
55 |
is( dt_from_string( $log->get_from_storage->timestamp ), $yesterday, |
56 |
'timestamp column should not be updated to current_timestamp' ); |
57 |
|
51 |
$schema->storage->txn_rollback; |
58 |
$schema->storage->txn_rollback; |
52 |
}; |
59 |
}; |
53 |
|
60 |
|
54 |
- |
|
|