c5463dab90b28c961d0d11418da82414c8d4b3cc
[koha-equinox.git] / t / timezones.t
1 use Modern::Perl;
2
3 use C4::Context;
4
5 use Test::More tests => 3;
6 use t::lib::Mocks;
7
8 $ENV{TZ} = q{};
9 t::lib::Mocks::mock_config( 'timezone', q{} );
10 is( C4::Context->timezone, 'local',
11     'Got local timezone with no env or config timezone set' );
12
13 $ENV{TZ} = 'Antarctica/Macquarie';
14 is(
15     C4::Context->timezone,
16     'Antarctica/Macquarie',
17     'Got correct timezone using ENV, overrides local time'
18 );
19
20 t::lib::Mocks::mock_config( 'timezone', 'Antarctica/South_Pole' );
21 is(
22     C4::Context->timezone,
23     'Antarctica/South_Pole',
24     'Got correct timezone using config, overrides env'
25 );