pajoye Sun, 04 Sep 2011 21:40:22 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=316115
Log: - fix test on win, does not use putenv to set the TZ but date_default_timezone_set (should be the case on all platforms actually...) Changed paths: U php/php-src/branches/PHP_5_3/ext/date/tests/date.phpt U php/php-src/branches/PHP_5_4/ext/date/tests/date.phpt U php/php-src/trunk/ext/date/tests/date.phpt Modified: php/php-src/branches/PHP_5_3/ext/date/tests/date.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/date/tests/date.phpt 2011-09-04 20:23:57 UTC (rev 316114) +++ php/php-src/branches/PHP_5_3/ext/date/tests/date.phpt 2011-09-04 21:40:22 UTC (rev 316115) @@ -3,14 +3,22 @@ --FILE-- <?php $tmp = "cr"; -putenv ("TZ=GMT0"); +if (defined('PHP_WINDOWS_VERSION_MAJOR')) { + date_default_timezone_set('GMT0'); +} else { + putenv ("TZ=GMT0"); +} + for($a = 0;$a < strlen($tmp); $a++){ echo $tmp[$a], ': ', date($tmp[$a], 1043324459)."\n"; } -putenv ("TZ=MET"); - +if (defined('PHP_WINDOWS_VERSION_MAJOR')) { + date_default_timezone_set("MET"); +} else { + putenv ("TZ=MET"); +} for($a = 0;$a < strlen($tmp); $a++){ echo $tmp[$a], ': ', date($tmp[$a], 1043324459)."\n"; } Modified: php/php-src/branches/PHP_5_4/ext/date/tests/date.phpt =================================================================== --- php/php-src/branches/PHP_5_4/ext/date/tests/date.phpt 2011-09-04 20:23:57 UTC (rev 316114) +++ php/php-src/branches/PHP_5_4/ext/date/tests/date.phpt 2011-09-04 21:40:22 UTC (rev 316115) @@ -3,14 +3,22 @@ --FILE-- <?php $tmp = "cr"; -putenv ("TZ=GMT0"); +if (defined('PHP_WINDOWS_VERSION_MAJOR')) { + date_default_timezone_set('GMT0'); +} else { + putenv ("TZ=GMT0"); +} + for($a = 0;$a < strlen($tmp); $a++){ echo $tmp[$a], ': ', date($tmp[$a], 1043324459)."\n"; } -putenv ("TZ=MET"); - +if (defined('PHP_WINDOWS_VERSION_MAJOR')) { + date_default_timezone_set("MET"); +} else { + putenv ("TZ=MET"); +} for($a = 0;$a < strlen($tmp); $a++){ echo $tmp[$a], ': ', date($tmp[$a], 1043324459)."\n"; } Modified: php/php-src/trunk/ext/date/tests/date.phpt =================================================================== --- php/php-src/trunk/ext/date/tests/date.phpt 2011-09-04 20:23:57 UTC (rev 316114) +++ php/php-src/trunk/ext/date/tests/date.phpt 2011-09-04 21:40:22 UTC (rev 316115) @@ -3,14 +3,22 @@ --FILE-- <?php $tmp = "cr"; -putenv ("TZ=GMT0"); +if (defined('PHP_WINDOWS_VERSION_MAJOR')) { + date_default_timezone_set('GMT0'); +} else { + putenv ("TZ=GMT0"); +} + for($a = 0;$a < strlen($tmp); $a++){ echo $tmp[$a], ': ', date($tmp[$a], 1043324459)."\n"; } -putenv ("TZ=MET"); - +if (defined('PHP_WINDOWS_VERSION_MAJOR')) { + date_default_timezone_set("MET"); +} else { + putenv ("TZ=MET"); +} for($a = 0;$a < strlen($tmp); $a++){ echo $tmp[$a], ': ', date($tmp[$a], 1043324459)."\n"; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php