add tests to DateTime to guarantee that add works
This commit is contained in:
parent
3930e1415d
commit
6c6aad240d
1 changed files with 9 additions and 1 deletions
|
|
@ -23,7 +23,7 @@ my $session = WebGUI::Test->session;
|
|||
|
||||
# put your tests here
|
||||
|
||||
my $numTests = 1 + 13;
|
||||
my $numTests = 1 + 17;
|
||||
plan tests => $numTests;
|
||||
|
||||
my $loaded = use_ok("WebGUI::DateTime");
|
||||
|
|
@ -56,6 +56,14 @@ is($copiedDt->toUserTimeZone(), "2006-11-06 14:12:45", "toUserTimeZone obeys
|
|||
is($copiedDt->toUserTimeZoneDate(), "2006-11-06", "toUserTimeZoneDate obeys the time zone");
|
||||
is($copiedDt->toUserTimeZoneTime(), "14:12:45", "toUserTimeZoneTime obeys the time zone");
|
||||
|
||||
$copiedDt->add(hours => 1);
|
||||
|
||||
isa_ok($copiedDt, "WebGUI::DateTime", "add returns itself");
|
||||
isa_ok($copiedDt->session, "WebGUI::Session", "add does not nuke $session");
|
||||
|
||||
is($copiedDt->time_zone()->name, "America/Hermosillo", "add does not change the time zone");
|
||||
is($copiedDt->toUserTimeZone(), "2006-11-06 15:12:45", "add returns the correct time");
|
||||
|
||||
my $epochDt = WebGUI::DateTime->new($session, "1169141075");
|
||||
isa_ok($epochDt, "WebGUI::DateTime", "epochal construction");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue