Bug 36486: Fix file perms and tidiness
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
e6382d04ad
commit
8d24f3e80e
1 changed files with 27 additions and 27 deletions
54
t/Koha/DateTime/Format/SQL.t
Normal file → Executable file
54
t/Koha/DateTime/Format/SQL.t
Normal file → Executable file
|
@ -8,10 +8,10 @@ use Test::More;
|
||||||
|
|
||||||
BEGIN { use_ok('Koha::DateTime::Format::SQL'); }
|
BEGIN { use_ok('Koha::DateTime::Format::SQL'); }
|
||||||
|
|
||||||
my $local_timezone = DateTime::TimeZone->new( name => 'local' );
|
my $local_timezone = DateTime::TimeZone->new( name => 'local' );
|
||||||
my $koha_config_mock = Test::MockModule->new('Koha::Config');
|
my $koha_config_mock = Test::MockModule->new('Koha::Config');
|
||||||
my $config = { timezone => '' };
|
my $config = { timezone => '' };
|
||||||
$koha_config_mock->mock('get', sub { $config->{$_[1]} });
|
$koha_config_mock->mock( 'get', sub { $config->{ $_[1] } } );
|
||||||
|
|
||||||
subtest 'normal datetime, no timezone configured' => sub {
|
subtest 'normal datetime, no timezone configured' => sub {
|
||||||
plan tests => 7;
|
plan tests => 7;
|
||||||
|
@ -21,12 +21,12 @@ subtest 'normal datetime, no timezone configured' => sub {
|
||||||
|
|
||||||
my $dt = Koha::DateTime::Format::SQL->parse_datetime('2024-01-02 10:11:12');
|
my $dt = Koha::DateTime::Format::SQL->parse_datetime('2024-01-02 10:11:12');
|
||||||
|
|
||||||
is( $dt->year, 2024 );
|
is( $dt->year, 2024 );
|
||||||
is( $dt->month, 1 );
|
is( $dt->month, 1 );
|
||||||
is( $dt->day, 2 );
|
is( $dt->day, 2 );
|
||||||
is( $dt->hour, 10 );
|
is( $dt->hour, 10 );
|
||||||
is( $dt->minute, 11 );
|
is( $dt->minute, 11 );
|
||||||
is( $dt->second, 12 );
|
is( $dt->second, 12 );
|
||||||
is( $dt->time_zone->name, $local_timezone->name );
|
is( $dt->time_zone->name, $local_timezone->name );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -38,12 +38,12 @@ subtest 'normal datetime, with timezone configured' => sub {
|
||||||
|
|
||||||
my $dt = Koha::DateTime::Format::SQL->parse_datetime('2024-01-02 10:11:12');
|
my $dt = Koha::DateTime::Format::SQL->parse_datetime('2024-01-02 10:11:12');
|
||||||
|
|
||||||
is( $dt->year, 2024 );
|
is( $dt->year, 2024 );
|
||||||
is( $dt->month, 1 );
|
is( $dt->month, 1 );
|
||||||
is( $dt->day, 2 );
|
is( $dt->day, 2 );
|
||||||
is( $dt->hour, 10 );
|
is( $dt->hour, 10 );
|
||||||
is( $dt->minute, 11 );
|
is( $dt->minute, 11 );
|
||||||
is( $dt->second, 12 );
|
is( $dt->second, 12 );
|
||||||
is( $dt->time_zone->name, 'Pacific/Auckland' );
|
is( $dt->time_zone->name, 'Pacific/Auckland' );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -55,12 +55,12 @@ subtest 'infinite datetime, no timezone configured' => sub {
|
||||||
|
|
||||||
my $dt = Koha::DateTime::Format::SQL->parse_datetime('9999-01-02 10:11:12');
|
my $dt = Koha::DateTime::Format::SQL->parse_datetime('9999-01-02 10:11:12');
|
||||||
|
|
||||||
is( $dt->year, 9999 );
|
is( $dt->year, 9999 );
|
||||||
is( $dt->month, 1 );
|
is( $dt->month, 1 );
|
||||||
is( $dt->day, 2 );
|
is( $dt->day, 2 );
|
||||||
is( $dt->hour, 10 );
|
is( $dt->hour, 10 );
|
||||||
is( $dt->minute, 11 );
|
is( $dt->minute, 11 );
|
||||||
is( $dt->second, 12 );
|
is( $dt->second, 12 );
|
||||||
is( $dt->time_zone->name, 'floating' );
|
is( $dt->time_zone->name, 'floating' );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -72,12 +72,12 @@ subtest 'normal datetime, with timezone configured' => sub {
|
||||||
|
|
||||||
my $dt = Koha::DateTime::Format::SQL->parse_datetime('9999-01-02 10:11:12');
|
my $dt = Koha::DateTime::Format::SQL->parse_datetime('9999-01-02 10:11:12');
|
||||||
|
|
||||||
is( $dt->year, 9999 );
|
is( $dt->year, 9999 );
|
||||||
is( $dt->month, 1 );
|
is( $dt->month, 1 );
|
||||||
is( $dt->day, 2 );
|
is( $dt->day, 2 );
|
||||||
is( $dt->hour, 10 );
|
is( $dt->hour, 10 );
|
||||||
is( $dt->minute, 11 );
|
is( $dt->minute, 11 );
|
||||||
is( $dt->second, 12 );
|
is( $dt->second, 12 );
|
||||||
is( $dt->time_zone->name, 'floating' );
|
is( $dt->time_zone->name, 'floating' );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue