Line 0
Link Here
|
0 |
- |
1 |
use Modern::Perl; |
|
|
2 |
use DateTime; |
3 |
use DateTime::TimeZone; |
4 |
|
5 |
use C4::Context; |
6 |
|
7 |
use Test::More tests => 3; |
8 |
|
9 |
use t::lib::Mocks; |
10 |
|
11 |
$ENV{TZ} = q{}; |
12 |
t::lib::Mocks::mock_config( 'timezone', q{} ); |
13 |
is( C4::Context->timezone, 'local', 'Got local timezone with no env or config timezone set' ); |
14 |
|
15 |
$ENV{TZ} = 'Antarctica/Macquarie'; |
16 |
is( C4::Context->timezone, 'Antarctica/Macquarie', 'Got correct timezone using ENV, overrides local time' ); |
17 |
|
18 |
t::lib::Mocks::mock_config( 'timezone', 'Antarctica/South_Pole' ); |
19 |
is( C4::Context->timezone, 'Antarctica/South_Pole', 'Got correct timezone using config, overrides env' ); |