我也遇到了这个问题,因为工作的服务器仍在 PHP 5.2 上,并且直接从 PEAR 安装 PHPUnit 选择了一些与 PHP 5.2 不兼容的包的错误版本。
为了修复安装:
1)我首先从频道 phpunit卸载了所有软件包。
2)接下来我安装了冲突包的正确版本:
pear install pear.phpunit.de/File_Iterator-1.3.2
pear install pear.phpunit.de/Text_Template-1.1.2
pear install pear.phpunit.de/PHP_Timer-1.0.2
3)接下来我可以安装 phpunit:
[root@DanielGarcia ~]# pear install pear.phpunit.de/phpunit
Did not download optional dependencies: pear.phpunit.de/PHP_Invoker, use --alldeps to download automatically
phpunit/PHPUnit can optionally use package "pear.phpunit.de/PHP_Invoker" (version >= 1.1.0)
downloading PHPUnit-3.6.12.tgz ...
Starting to download PHPUnit-3.6.12.tgz (120,240 bytes)
..........................done: 120,240 bytes
downloading PHP_CodeCoverage-1.1.4.tgz ...
Starting to download PHP_CodeCoverage-1.1.4.tgz (132,781 bytes)
...done: 132,781 bytes
downloading PHPUnit_MockObject-1.1.1.tgz ...
Starting to download PHPUnit_MockObject-1.1.1.tgz (19,910 bytes)
...done: 19,910 bytes
downloading PHP_TokenStream-1.1.4.tgz ...
Starting to download PHP_TokenStream-1.1.4.tgz (9,877 bytes)
...done: 9,877 bytes
install ok: channel://pear.phpunit.de/PHPUnit_MockObject-1.1.1
install ok: channel://pear.phpunit.de/PHP_TokenStream-1.1.4
install ok: channel://pear.phpunit.de/PHP_CodeCoverage-1.1.4
install ok: channel://pear.phpunit.de/PHPUnit-3.6.12**