5 use Test::More tests => 5;
9 use DateTime::TimeZone;
12 t::lib::Mocks::mock_config( 'timezone', q{} );
13 is( C4::Context->timezone, 'local',
14 'Got local timezone with no env or config timezone set' );
16 $ENV{TZ} = 'Antarctica/Macquarie';
18 C4::Context->timezone,
19 'Antarctica/Macquarie',
20 'Got correct timezone using ENV, overrides local time'
23 t::lib::Mocks::mock_config( 'timezone', 'Antarctica/South_Pole' );
25 C4::Context->timezone,
26 'Antarctica/South_Pole',
27 'Got correct timezone using config, overrides env'
30 t::lib::Mocks::mock_config( 'timezone', 'Your/Timezone' );
32 is( C4::Context->timezone, 'local', 'Invalid timezone falls back to local' ); }
33 'Invalid timezone in koha-conf.xml (Your/Timezone)',
34 'Invalid timezone raises a warning';