Question by beanland
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
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
Why am I getting this error and how can I fix it?
Answer by David Harkness
Answer by Starx
For some, Anthony’s solution will not work fully because of the
Unknown remote channel: pear.symfony.com or
phpunit/PHPUnit requires package "channel://pear.symfony.com/Yaml".
SO here is the upgraded solution that solves this:
sudo apt-get remove phpunit sudo pear channel-discover pear.phpunit.de sudo pear channel-discover pear.symfony-project.com sudo pear channel-discover components.ez.no sudo pear channel-discover pear.symfony.com sudo pear update-channels sudo pear upgrade-all sudo pear install pear.symfony.com/Yaml sudo pear install --alldeps phpunit/PHPUnit sudo pear install --force --alldeps phpunit/PHPUnit