2

I am trying to get familiar with testing (unit, functional) under Symfony 2.3.24/Windows7/PHP 5.4.7.

It seems PHPUnit is installed correctly (via Composer), but when I run a phpunit -c app/ command I get the following error:

Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in C:\xampp\php\phpunit on line 38

Fatal error: require_once(): Failed opening required 'PHP/CodeCoverage/Filter.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\php\phpunit on line 38

I googled for the issue to no avail. I additionnaly found in the official PHPUnit website that The code coverage report feature requires the Xdebug (2.1.3 or later) and tokenizer extensions.

What do you think about all this? your help is much appreciated.

4
  • check php -i (or phpinfo() output). Are the extensions mentioned on PHPUnit installed? (Xdebug and tokenized), and are they enabled? Commented Jan 23, 2015 at 14:39
  • @EliasVanOotegem, thank you first. phpinfo() page tells that Tokenizer support is enabled. But for Xdebug, I find no info on the page. I checked symfony profiler page and Xdebug is disabled. Do I need to uncomment the specific lines in php.ini? Note that there is no line in phpinfo for PHPUnit. Should it exist? Commented Jan 23, 2015 at 14:45
  • 1
    I suspect you'll have to install Xdebug yourself (google will tell you how) Commented Jan 23, 2015 at 15:30
  • You are right, I was thinking that Xdebug is enabled after uncommenting the specific lines on php.ini, but it was not sufficient since I need also to change value of xdebug.remote_enable to 1. Thank you very much. Commented Jan 30, 2015 at 10:29

1 Answer 1

5

In current versions of PHPUnit the phpunit script does not include PHP/CodeCoverage/Filter.php directly. It appears you are using an outdated version of PHPUnit and/or have a mixup of Composer/PEAR installations.

Please follow the instructions on https://phpunit.de/getting-started.html to properly install PHPUnit. And http://thephp.cc/news/2015/01/phpunit-migration-from-pear-to-phar explains how to migrate from a PEAR-based installation to Composer or PHAR.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.