Call to undefined method PHP_CodeCoverage_Filter::getInstance()

前端 未结 7 2374
后悔当初
后悔当初 2020-12-04 14:13

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 Fa

7条回答
  •  长情又很酷
    2020-12-04 14:56

    Ubuntu 11.10 has had an issue for a while that hasn't been fixed. This is the only thing that will get phpunit to work with pear. (Outside of using pear you can look up a way to do it without pear. There is an article online about that but I wouldn't want that kind of burden to do it manually). This is the only thing that worked for me:

    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 update-channels
    
    sudo pear upgrade-all
    
    sudo pear install --alldeps phpunit/PHPUnit
    
    sudo pear install --force --alldeps phpunit/PHPUnit
    

提交回复
热议问题