调用未定义的方法PHP_CodeCoverage_Filter :: getInstance() [英] Call to undefined method PHP_CodeCoverage_Filter::getInstance()
问题描述
我已经在系统(Ubuntu 11)上安装了PHPUnit的新副本,但是每当我在控制台中键入phpunit
时,都会出现以下错误:
I've got a fresh copy of PHPUnit installed on my system (Ubuntu 11), but whenever I type phpunit
in the console I get the following error:
PHP Fatal error: Call to undefined method PHP_CodeCoverage_Filter::getInstance() in /usr/bin/phpunit on line 39
据我所知,我已经安装了PHPUnit的代码范围:
I have PHPUnit's code coverage installed, as far as I know:
>sudo pear install phpunit/PHP_CodeCoverage
phpunit/PHP_CodeCoverage is already installed and is the same as the released version 1.1.1
install failed
为什么会出现此错误,我该如何解决?
Why am I getting this error and how can I fix it?
推荐答案
在转到3.6.x时,必须未更新加载PHPUnit的可执行脚本.重新安装.
The executable script that loads PHPUnit must not have been updated when going to 3.6.x. Reinstall it.
sudo pear uninstall phpunit/PHPUnit
sudo pear install phpunit/PHPUnit
如果这不起作用,请 查看全文