From: Melvyn Sopacua Date: Tue, 9 Sep 2003 21:31:51 +0000 (+0000) Subject: Fix testcases, failing with 'America/New_York' vs. 'US/Eastern' systems X-Git-Tag: php-4.3.4RC1~79 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4aacd42826ae291a04da6ef9a90e98308c0b42fa;p=php Fix testcases, failing with 'America/New_York' vs. 'US/Eastern' systems and fallback to POSIX-style. The fallback is based on tzset(3) manpage [1] for these systems and may apply to past and future unknowns as well. Affected systems: 4.4BSD Possible problem: OSF Proposed solution: leave testcase as is, and if OSF systems start failing during next qa-cycle, always use POSIX style in testcases and add portability note to docs. # [1] If the TZ environment variable does not specify a tzfile(5)-format # file and cannot be interpreted as a direct specification, UTC is # used. --- diff --git a/ext/standard/tests/time/002.phpt b/ext/standard/tests/time/002.phpt index 1bed70c14c..4aeffac400 100644 --- a/ext/standard/tests/time/002.phpt +++ b/ext/standard/tests/time/002.phpt @@ -33,12 +33,12 @@ if (!@putenv("TZ=EST") || getenv("TZ") != 'EST') { echo date ("Y-m-d H:i:s\n", strtotime ($date)); } - if (PHP_OS === "OSF1") { + putenv("TZ=US/Eastern"); + if( date("T") == "GMT" ) { // POSIX style putenv ("TZ=EST5EDT4,M4.1.0,M10.5.0"); - } else { - putenv ("TZ=US/Eastern"); } + foreach ($dates as $date) { echo date ("Y-m-d H:i:s\n", strtotime ($date)); } diff --git a/ext/standard/tests/time/bug13142.phpt b/ext/standard/tests/time/bug13142.phpt index f021bea6aa..af3e1f2f31 100644 --- a/ext/standard/tests/time/bug13142.phpt +++ b/ext/standard/tests/time/bug13142.phpt @@ -9,6 +9,9 @@ if (!@putenv("TZ=US/Eastern") || getenv("TZ") != 'US/Eastern') { --FILE--