aboutsummaryrefslogtreecommitdiffstats
path: root/t/04-Shared_TimeZone.t
diff options
context:
space:
mode:
Diffstat (limited to 't/04-Shared_TimeZone.t')
-rw-r--r--t/04-Shared_TimeZone.t14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/04-Shared_TimeZone.t b/t/04-Shared_TimeZone.t
index 26f9bfc9..f11bb2c6 100644
--- a/t/04-Shared_TimeZone.t
+++ b/t/04-Shared_TimeZone.t
@@ -2,6 +2,8 @@ use 5.006;
use strict;
use warnings FATAL => 'all';
use Test::More;
+use Data::Dumper;
+use Time::Piece;
BEGIN {
use_ok( 'AdminPanel::Shared::TimeZone' ) || print "AdminPanel::Shared::TimeZone failed!\n";
@@ -11,9 +13,21 @@ BEGIN {
is( $tz->get_timezone_prefix(), '/usr/share/zoneinfo', 'get_timezone_prefix' );
ok (my @l = $tz->getTimeZones(), 'getTimeZones');
ok (my $h = $tz->readConfiguration(), 'readConfiguration');
+ diag Dumper($h);
ok (my $s = $tz->ntpCurrentServer(), 'currentNTPServer');
diag "ntpCurrentServer got: < " . ($s ? $s : "none") . " >";
ok (my $a = ($tz->isNTPRunning() ? "running" : "not running"), 'isNTPRunning');
diag "isNTPRunning got: < " . $a . " >";
+ SKIP: {
+ #remember to skip the right number of tests
+ skip "To enable dialog tests set TEST_SET_DBUS", 3, unless $ENV{TEST_SET_DBUS};
+ eval {$tz->setLocalRTC(!$h->{UTC})};
+ is ($@, "", 'setLocalRTC' );
+ eval {$tz->setTimeZone($h->{ZONE})};
+ is ($@, "", 'setTimeZone');
+ my $t = localtime;
+ eval {$tz->setTime($t->epoch())};
+ is ($@, "", 'setTime');
+ }
done_testing;