ZF-1989: Unit tests under default configuration require exceptionally long time


The unit tests for Zend_Currency under the default configuration appear to require an exceptionally long time to run, relative to the tests for other framework components. If there is some way to significantly improve the performance of these tests without compromising their effectiveness, we should make an effort to do this.


On my testbed it requires 6 to 22 seconds... I added caching tests which increased speed to 3-15 seconds.

But in my opinon even 22 seconds are a normal time for a complete testbed.

C:\3rdParty\Zend Framework\tests>phpunit --report C:\temp\reports Zend
PHPUnit 3.1.0beta2 by Sebastian Bergmann.


Time: 14 seconds

OK (12 tests)

Generating report, this may take a moment.Der Befehl "neato" ist entweder falsch
 geschrieben oder
konnte nicht gefunden werden.

Maybe I just need a faster computer. ;)

I was able to get the tests to run in 16 seconds, so I'll resolve this issue.

When I ran the tests, however, I did encounter many many warnings of the following nature:

Warning: implode(): Argument to implode must be an array. in trunk\library\Zend\Locale\Data.php on line 265

Call Stack:
    0.0016   1. {main}() PEAR\PHPUnit\TextUI\Command.php:0
    0.6633   2. PHPUnit_TextUI_Command::main() PEAR\PHPUnit\TextUI\Command.php:463
    1.1373   3. PHPUnit_TextUI_TestRunner->doRun() PEAR\PHPUnit\TextUI\Command.php:106
    1.1376   4. PHPUnit_Framework_TestSuite->run() PEAR\PHPUnit\TextUI\TestRunner.php:299
   17.3058   5. PHPUnit_Framework_TestSuite->runTest() PEAR\PHPUnit\Framework\TestSuite.php:526
   17.3058   6. PHPUnit_Framework_TestCase->run() PEAR\PHPUnit\Framework\TestSuite.php:546
   17.3058   7. PHPUnit_Framework_TestResult->run() PEAR\PHPUnit\Framework\TestCase.php:277
   17.3059   8. PHPUnit_Framework_TestCase->runBare() PEAR\PHPUnit\Framework\TestResult.php:548
   17.3117   9. PHPUnit_Framework_TestCase->runTest() PEAR\PHPUnit\Framework\TestCase.php:299
   17.3117  10. ReflectionMethod->invoke() PEAR\PHPUnit\Framework\TestCase.php:365
   17.3117  11. Zend_CurrencyTest->testToString() trunk\tests\Zend\CurrencyTest.php:0
   17.3118  12. Zend_Currency->__construct() trunk\tests\Zend\CurrencyTest.php:495
   17.3295  13. Zend_Currency->_updateFormat() trunk\library\Zend\Currency.php:188
   17.3295  14. Zend_Locale_Data::getContent() trunk\library\Zend\Currency.php:214
   17.3296  15. implode() trunk\library\Zend\Locale\Data.php:265

I'll create a separate issue for this.

These error has already been fixed with SVN 6504 when I added caching support.

Nevermind - you already fixed it. Thanks, Thomas! :)