PHPStorm has a custom PHPUnit runner script ( ide-phpunit.php ) that it uses internally to deal with different versions of PHPUnit and to do the IDE integration and that is just relying on the include path and the PEAR folder layout.
To do that it executes:
public static function checkIncludePath()
{
//check include path
$PHPUnitParentDirectory = self::getPHPUnitParentDirectory();
if (is_null($PHPUnitParentDirectory)) {
echo "Cannot find PHPUnit in include path (" . ini_get('include_path') . ")";
exit(IDE_PHPUnit_Loader::FAILURE_EXIT);
}
}
/**
* @return null | string
*/
private static function getPHPUnitParentDirectory()
{
$pathArray = explode(PATH_SEPARATOR, ini_get('include_path'));
foreach ($pathArray as $path)
{
if (file_exists($path . DIRECTORY_SEPARATOR . 'PHPUnit/')) {
return $path;
}
}
return null;
}
You could just install it via composer and add it as a normal executable (ant/phing/native task) but you will loose all the shiny features PHPStorm offers like the progress bar, jumping to a failing test and the code coverage support.
So from the code you can tell taht you need to add a folder called named PHPUnit to one of the places in your include path. Adding vendor might help there but keep in mind it needs to match case when doing so.
Until PHPStorm supports using PHPUnit from composer or a phar I don't think you will get better integration ( http://youtrack.jetbrains.com/issue/WI-13429 ) with using it from pear but hacking your include path might work out.
The PHPStorm guys did some updates on the runner for 3.7 and are usually quite responsive to changes in PHPUnit :)