|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-09-14 14:50 UTC] ppryor at pobox dot com
Description:
------------
The test script, ext/standard/tests/time/002.phpt always fails on AIX because AIX does not support setting of TZ to US/Eastern, and the if statement that checks for this situation fails.
Orignal code in test case:
putenv("TZ=US/Eastern");
if( date("T") == "GMT" ) {
// POSIX style
putenv ("TZ=EST5EDT4,M4.1.0,M10.5.0");
}
should be modified as follows:
putenv("TZ=US/Eastern");
if( date("T") == "GMT" || date("T") == " " ) {
// POSIX style
putenv ("TZ=EST5EDT4,M4.1.0,M10.5.0");
}
Then it will pass the test. IMHO this problem applies to several platforms, not just AIX. The function date("t") could return a string of three spaces under certain circumstances.
Reproduce code:
---------------
base=`pwd`
cd ext/standard/tests/time
export TEST_PHP_EXECUTABLE=$base/sapi/cli/php
$TEST_PHP_EXECUTABLE $base/run-tests.php 002.phpt
Expected result:
----------------
=====================================================================
CWD : /home/ppryor/php-4.4.7/ext/standard/tests/time
PHP : /home/ppryor/php-4.4.7/sapi/cli/php
PHP_SAPI : cli
PHP_VERSION : 4.4.7
ZEND_VERSION: 1.3.0
PHP_OS : AIX - AIX EFT_QA02 2 5 00015D2A4C00
INI actual :
More .INIs :
Extra dirs :
=====================================================================
Running selected tests.
PASS strtotime() function [002.phpt]
Actual result:
--------------
=====================================================================
CWD : /home/ppryor/php-4.4.7/ext/standard/tests/time
PHP : /home/ppryor/php-4.4.7/sapi/cli/php
PHP_SAPI : cli
PHP_VERSION : 4.4.7
ZEND_VERSION: 1.3.0
PHP_OS : AIX - AIX EFT_QA02 2 5 00015D2A4C00
INI actual :
More .INIs :
Extra dirs :
=====================================================================
Running selected tests.
FAIL strtotime() function [002.phpt]
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 10:00:02 2025 UTC |
I found same problem with ext/standard/tests/time/bug13142.phpt, so I modified the test case as follows: Original putenv("TZ=US/Eastern"); if (date('T') == 'GMT') { putenv("TZ=EST5EDT4,M4.1.0,M10.5.0"); } Revised putenv("TZ=US/Eastern"); if (date('T') == 'GMT' || date('T') == ' ') { putenv("TZ=EST5EDT4,M4.1.0,M10.5.0"); } Then it will pass the test.