msopacua Tue Sep 9 17:31:52 2003 EDT
Modified files: (Branch: PHP_4_3)
/php-src/ext/standard/tests/time bug13142.phpt 002.phpt
Log:
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.
Index: php-src/ext/standard/tests/time/bug13142.phpt
diff -u php-src/ext/standard/tests/time/bug13142.phpt:1.1.2.2
php-src/ext/standard/tests/time/bug13142.phpt:1.1.2.3
--- php-src/ext/standard/tests/time/bug13142.phpt:1.1.2.2 Tue Aug 5 08:29:41
2003
+++ php-src/ext/standard/tests/time/bug13142.phpt Tue Sep 9 17:31:51 2003
@@ -9,6 +9,9 @@
--FILE--
<?php
putenv("TZ=US/Eastern");
+if (date('T') == 'GMT') {
+ putenv("TZ=EST5EDT4,M4.1.0,M10.5.0");
+}
echo date("r\n", strtotime("Sep 04 16:39:45 2001"));
echo date("r\n", strtotime("Sep 04 2001 16:39:45"));
?>
Index: php-src/ext/standard/tests/time/002.phpt
diff -u php-src/ext/standard/tests/time/002.phpt:1.4.2.4
php-src/ext/standard/tests/time/002.phpt:1.4.2.5
--- php-src/ext/standard/tests/time/002.phpt:1.4.2.4 Thu Aug 7 13:46:40 2003
+++ php-src/ext/standard/tests/time/002.phpt Tue Sep 9 17:31:51 2003
@@ -33,12 +33,12 @@
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));
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php