Unable to run unit tests in PHPStorm's IDE

composer-php, php, phpstorm, phpunit, unit-testing

Solution

PhpStorm uses wrapper/helper script when executing PHPUnit tests (for integration purposes: monitor execution progress, stack trace etc).

At the moment that helper script does not support PHPUnit 3.8 or 3.9 -- only 3.7 and below.

Corresponding ticket: http://youtrack.jetbrains.com/issue/WI-21666 -- watch it (star/vote/comment) to get notified when it will be resolved.

P.S. This issue is now fixed and fix will be available in next public EAP build (newer than current 134.1456).

Problem

When I run `vendor/bin/phpunit` my tests all run successfully. However, when I right click on a tests file and click "Run tests" I end up seeing: ``` /usr/local/bin/php -dxdebug.coverage_enable=1 /private/var/folders/bj/t2w187x158g7rgghctgknwb80000gn/T/ide-phpunit.php --coverage-clover /Users/bkuhl/Library/Caches/WebIde70/coverage/services$tests.coverage --no-configuration /Users/bkuhl/Projects/myproject/services/app/tests Testing started at 3:09 PM ... Fatal error: Class IDE_PHPUnit_Framework_TestListener contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (PHPUnit_Framework_TestListener::addRiskyTest) in /private/var/folders/bj/t2w187x158g7rgghctgknwb80000gn/T/ide-phpunit.php on line 504 PHP Fatal error: Class IDE_PHPUnit_Framework_TestListener contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (PHPUnit_Framework_TestListener::addRiskyTest) in /private/var/folders/bj/t2w187x158g7rgghctgknwb80000gn/T/ide-phpunit.php on line 504 Call Stack: 0.0008 340040 1. {main}() /private/var/folders/bj/t2w187x158g7rgghctgknwb80000gn/T/ide-phpunit.php:0 PHP Stack trace: PHP 1. {main}() /private/var/folders/bj/t2w187x158g7rgghctgknwb80000gn/T/ide-phpunit.php:0 Process finished with exit code 255 ``` I have PHPStorm configured to use `path/to/vendor/autoload.php` I've temporarily changed the path of this directory for the purpose of this screenshot, but it is a perfectly valid path. Has anyone run into issues using PHPStorm's ability to run your tests? composer.json: ``` "require-dev": { "way/generators": "dev-master", "way/laravel-test-helpers": "dev-master", "mockery/mockery": "*", "codeception/aspect-mock": "*", "phpunit/phpunit": "3.9.*@dev" }, ```

Original source

Related problems