From 0fcc20760ab4c49ec7e3b93f9025a9b0b8d2046b Mon Sep 17 00:00:00 2001 From: "jake%bugzilla.org" <> Date: Thu, 28 Nov 2002 00:00:20 +0000 Subject: Bug 67077 - We now include the timezone (as configured in editparams.cgi) on every time we display. r=justdave a=justdave --- t/004template.t | 1 + t/007util.t | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 't') 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")'); + + -- cgit v1.2.3-24-g4f1b