PhpUnit error with PhpStorm 9.0.2

I have enjoyed using Eclipse PDT for my PHP development, but everyone else on the team is switching to PhpStorm, so I have put off the transition as long as possible, but today was the official cut off. In addition, I decided to go all out on the switch and begin doing all of my development in an Ubuntu VM on my Windows 10 machine. PHP was designed for Linux, and the ease of installation in Linux vs. Windows is well worth the time of getting a VM up and running.

One issue I ran into with PhpStorm v9.0.2 and PhpUnit v5.0.3 is a call to an undefined function:

PHP Fatal error: Call to undefined method PHP_CodeCoverage_Filter::addFileToBlacklist() in ~/.phpstorm_helpers/phpunit.php on line 321

For now, the way I fixed this was to downgrade my version of PhpUnit from 5.* to 4.8.* in my compser.json:

"require-dev": {
"phpunit/phpunit": "4.8.*"

Hope this saves someone else the time and effort I lost into trying to “fix” this issue while waiting for PhpUnit 5.1 in December.

About the Author


View Posts →

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.