0

I just installed PHP-CodeCoverage pear package and now when I try to run the test cases it gives this error, I will put the stack trace below for further details; I use the OS ubuntu 12.04LTS;

PHP Fatal error:  Cannot redeclare class PHP_CodeCoverage_Filter in /usr/share/php/PHP/CodeCoverage/Filter.php on line 58
PHP Stack trace:
PHP   1. {main}() /usr/local/bin/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /usr/local/bin/phpunit:583
PHP   3. PHPUnit_TextUI_Command->run() phar:///usr/local/bin/phpunit/phpunit/TextUI/Command.php:132
PHP   4. PHPUnit_Runner_BaseTestRunner->getTest() phar:///usr/local/bin/phpunit/phpunit/TextUI/Command.php:153
PHP   5. PHPUnit_Runner_BaseTestRunner->loadSuiteClass() phar:///usr/local/bin/phpunit/phpunit/Runner/BaseTestRunner.php:105
PHP   6. PHPUnit_Runner_StandardTestSuiteLoader->load() phar:///usr/local/bin/phpunit/phpunit/Runner/BaseTestRunner.php:162
PHP   7. PHPUnit_Util_Fileloader::checkAndLoad() phar:///usr/local/bin/phpunit/phpunit/Runner/StandardTestSuiteLoader.php:78
PHP   8. PHPUnit_Util_Fileloader::load() phar:///usr/local/bin/phpunit/phpunit/Util/Fileloader.php:77
PHP   9. include_once() phar:///usr/local/bin/phpunit/phpunit/Util/Fileloader.php:93
PHP  10. PHPUnitVersionHelper::includeRequiredFiles() /var/www/orangehrm/symfony/test/PluginAllTests.php:3
PHP  11. require_once() /var/www/orangehrm/symfony/test/util/PHPUnitVersionHelper.php:42
PHP  12. require_once() /usr/share/php/PHPUnit/Autoload.php:46
ssrp
  • 1,126
  • 5
  • 17
  • 35
  • A similar question is here : http://stackoverflow.com/questions/14028200/php-codecoverage-filtergetinstance-error-running-phpunit please let me know if this is what you searched for and if that solution worked for you – Paul Bele Apr 14 '14 at 13:01
  • I followed the instructions given there, but no luck now it gives the below error; `PHP Warning: require_once(PHPUnit/Runner/Version.php): failed to open stream: No such file or directory` – ssrp Apr 16 '14 at 02:33
  • how did you installed phpUnit ? through pear ? or is a local version per project ? If it's globally, you can simply reinstall it : sudo pear uninstall phpunit/PHPUnit sudo pear install phpunit/PHPUnit – Paul Bele Apr 16 '14 at 04:18

0 Answers0