6

I am trying to use PHPUnit in PhpStorm (on a Mac). Therefore I tried adding the pear path and phpunit path to the include path of PhpStorm (the ones I found through which pear on the command line) - it tells me that phpunit was not found.

I also tried to use PHPUnit with the custom autoloader generated by composer (the phpunit package is installed), I then receive another error:

Fatal error: Class 'PHP_CodeCoverage_Filter' not found

If I run phpunit on the console normally everything works:

phpunit --bootstrap vendor/autoload.php tests/*Test.php

What am I doing wrong?

2

1 Answer 1

7

The problem was that I used the default php interpreter which phpStorm suggested to me. This was version PHP 5.5 though and not the 5.6 version in my terminal.

After changing the interpreter to an up-to-date php version (5.6 or 7.0) it worked with the PHAR Option.

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

1 Comment

If it doesn't work for you, you can also try to downgrade phpunit/php-code-coverage to 3.3 as described in this thread: laracasts.com/discuss/channels/testing/…

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.