Without it phpunit bails out on some coverage reports with stack traces like this: Generating report, this may take a moment. Fatal error: Call to undefined function token_get_all() in /usr/share/php5/PHPUnit/Util/Report/Coverage/Node/File.php on line 377 Call Stack: 0.0003 125104 1. {main}() /usr/bin/phpunit:0 0.0035 309984 2. require('/usr/share/php5/PHPUnit/TextUI/Command.php') /usr/bin/phpunit:44 0.1115 5144360 3. PHPUnit_TextUI_Command::main() /usr/share/php5/PHPUnit/TextUI/Command.php:401 0.1980 5851064 4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/php5/PHPUnit/TextUI/Command.php:100 0.2330 6061872 5. PHPUnit_Util_Report::render() /usr/share/php5/PHPUnit/TextUI/TestRunner.php:258 0.2334 6065088 6. PHPUnit_Util_Report_Coverage_Factory::create() /usr/share/php5/PHPUnit/Util/Report.php:84 0.2377 6222496 7. PHPUnit_Util_Report_Coverage_Factory::addItems() /usr/share/php5/PHPUnit/Util/Report/Coverage/Factory.php:86 0.2377 6223336 8. PHPUnit_Util_Report_Coverage_Node_Directory->addFile() /usr/share/php5/PHPUnit/Util/Report/Coverage/Factory.php:104 0.2378 6225456 9. PHPUnit_Util_Report_Coverage_Node_File->__construct() /usr/share/php5/PHPUnit/Util/Report/Coverage/Node/Directory.php:136 0.2379 6227424 10. PHPUnit_Util_Report_Coverage_Node_File->highlightFile() /usr/share/php5/PHPUnit/Util/Report/Coverage/Node/File.php:131 Note that token_get_all comes with tokenizer extension. With tokenizer extension installed (USE="tokenizer") it works fine.
Created attachment 124297 [details, diff] diff against the ebuild in portage tree
Fixed in CVS, thankies :)
On that note, you should file a bug upstream, since tokenizer is marked as optional extension in package.xml (even w/ latest 3.1.7 version). required - dom, pcre, reflection, spl optional - json, pdo, pdo_mysql, pdo_sqlite, tokenizer, xdebug http://www.phpunit.de/report
It is optional, in the meaning that you can run unit tests without tokenizer. You just can't generate coverage reports without it. I don't know if they won't reject such a bug report then.