I'm developing a PHP5 program using IDEA 13.1. Of course I want to cover my code using some Unit tests. I installed phpunit via aptitude and upgraded it to 4.0.11 using pear.
Somehow IDEA seems unable to detect the installed PHPUnit... The class PHPUnit_Framework_TestCase is marked as undefined. The documentation on https://www.jetbrains.com/idea/webhelp/enabling-phpunit-support.html wants me to include either the pear directory (which does not exist) or the phpunit.phar (which does not exist, either).
So far most things went smooth with IDEA so I'm surprised that something as fundamental as setting up PHPUnit does not work :-(
Another solution: Set
in composer.json
and run
Then the issue will be resolved.
Ok, after some fiddling around I got to a working solution. I downloaded phpunit-lts.phar from phpunit.de and put it directly into the project (along with the other files... meh).
Do not use the most current version (4.0 as of 21st of march 2014) of PHPUnit! Versions beyond 3.7 (or 3.8, as it seems) are not supported by IDEA or PHPStorm. You will get
So do yourself a favor and stick to the LTS version for now.