Issues

ZF-2613: Fatal error running unit tests: Class 'DateTimeZone' not found

Description

When running "{{phpunit --verbose AllTests}}" (from {{trunk/tests}}), I get the following fatal error:

Fatal error: Class 'DateTimeZone' not found in c:\Documents and Settings\dfelton\My Documents\SVN Remote\Zend Framework\
trunk\library\Zend\Date.php on line 1336

Call Stack:
    0.0041   1. {main}() c:\wamp\php\PEAR\PHPUnit\TextUI\Command.php:0
    1.8150   2. PHPUnit_TextUI_Command::main() c:\wamp\php\PEAR\PHPUnit\TextUI\Command.php:528
   28.2982   3. PHPUnit_TextUI_TestRunner->doRun() c:\wamp\php\PEAR\PHPUnit\TextUI\Command.php:112
   28.2987   4. PHPUnit_Framework_TestSuite->run() C:\wamp\php\PEAR\PHPUnit\TextUI\TestRunner.php:295
   28.4082   5. PHPUnit_Framework_TestSuite->run() C:\wamp\php\PEAR\PHPUnit\Framework\TestSuite.php:647
   96.3383   6. PHPUnit_Framework_TestSuite->run() C:\wamp\php\PEAR\PHPUnit\Framework\TestSuite.php:647
   96.3386   7. PHPUnit_Framework_TestSuite->runTest() C:\wamp\php\PEAR\PHPUnit\Framework\TestSuite.php:664
   96.3386   8. PHPUnit_Framework_TestCase->run() C:\wamp\php\PEAR\PHPUnit\Framework\TestSuite.php:684
   96.3386   9. PHPUnit_Framework_TestResult->run() C:\wamp\php\PEAR\PHPUnit\Framework\TestCase.php:376
   96.3389  10. PHPUnit_Framework_TestCase->runBare() C:\wamp\php\PEAR\PHPUnit\Framework\TestResult.php:611
   96.4040  11. PHPUnit_Framework_TestCase->runTest() C:\wamp\php\PEAR\PHPUnit\Framework\TestCase.php:401
   96.4041  12. ReflectionMethod->invoke() C:\wamp\php\PEAR\PHPUnit\Framework\TestCase.php:476
   96.4041  13. Zend_DateTest->testCreation() c:\Documents and Settings\dfelton\My Documents\SVN Remote\Zend Framework\t
runk\tests\Zend\DateTest.php:0
   96.4075  14. Zend_Date->__construct() c:\Documents and Settings\dfelton\My Documents\SVN Remote\Zend Framework\trunk\
tests\Zend\DateTest.php:92
   96.4201  15. Zend_Date->getTimezoneFromString() c:\Documents and Settings\dfelton\My Documents\SVN Remote\Zend Framew
ork\trunk\library\Zend\Date.php:199

Comments

I forgot to mention that the results were from WinXP, PHP 5.1.4, PHPUnit 3.2.13 under the default test configuration ({{TestConfiguration.php.dist}}).

Interesting... because DateTimeZone is available since 5.1.0 within PHP and was build within the windows version since then...

Fixed with SVN-7920. Reworked internal timezone detection handling.

No more use of the simple DateTime classes. Has to be reworked as soon as the minimum requirements are raised.

Tested under XP with 5.1.4 and 5.2.5 with standard installation.