diff options
author | jake%bugzilla.org <> | 2002-11-28 01:00:20 +0100 |
---|---|---|
committer | jake%bugzilla.org <> | 2002-11-28 01:00:20 +0100 |
commit | 0fcc20760ab4c49ec7e3b93f9025a9b0b8d2046b (patch) | |
tree | d0b0499d6800b30420d6a96eb3ac87e5b6ff1eec /t | |
parent | bc3da73c9bfb25bab7416b473bdbcbed38d7ef3f (diff) | |
download | bugzilla-0fcc20760ab4c49ec7e3b93f9025a9b0b8d2046b.tar.gz bugzilla-0fcc20760ab4c49ec7e3b93f9025a9b0b8d2046b.tar.xz |
Bug 67077 - We now include the timezone (as configured in editparams.cgi) on every time we display.
r=justdave
a=justdave
Diffstat (limited to 't')
-rw-r--r-- | t/004template.t | 1 | ||||
-rw-r--r-- | t/007util.t | 17 |
2 files changed, 17 insertions, 1 deletions
diff --git a/t/004template.t b/t/004template.t index bbcb9f860..6c44fca48 100644 --- a/t/004template.t +++ b/t/004template.t @@ -82,6 +82,7 @@ my $provider = Template::Provider->new( strike => sub { return $_ } , url_quote => sub { return $_ } , csv => sub { return $_ } , + time => sub { return $_ } , }, } ); diff --git a/t/007util.t b/t/007util.t index a683f407e..c32087d32 100644 --- a/t/007util.t +++ b/t/007util.t @@ -40,10 +40,19 @@ use lib 't'; use Support::Files; BEGIN { - use Test::More tests => 10; + use Test::More tests => 12; use_ok(Bugzilla::Util); } +# We need to override the the Param() function so we can get an expected +# value when Bugzilla::Utim::format_time calls asks for Param('timezone'). +# This will also prevent the tests from failing on site that do not have a +# data/params file containing Param('timezone') yet. +sub myParam { + return "TEST" if $_[0] eq 'timezone'; +} +*::Param = *myParam; + # we don't test the taint functions since that's going to take some more work. # XXX: test taint functions @@ -69,3 +78,9 @@ is(min(@list),2,'min()'); #trim(): is(trim(" fg<*\$%>+=~~ "),'fg<*$%>+=~~','trim()'); + +#format_time(); +is(format_time("20021123140436"),'2002-11-23 14:04 TEST','format_time("20021123140436")'); +is(format_time("2002.11.24 00:05:56"),'2002-11-24 00:05 TEST','format_time("2002.11.24 00:05:56")'); + + |