PHPUnit Runner: Class IDE_PHPUnit_Framework_TestListener contains 1 abstract method... というエラーが出るケースの対処法。
(参考)
http://stackoverflow.com/questions/21415898/unable-to-run-unit-tests-in-phpstorms-ide
現状のPhpStorm(7.1.3)はPHPUnit 3.7より上のやつに対応していないみたい。(2014-04-20現在)
PHPUnitのバージョンを 3.7にすればOK.
1. phpunit 3.7の配置
PHPUnitのサイトから古いバージョンをダウンロードして /usr/local/bin/phpunit-3.7.phar に配置
2. PhpStormの設定
Preferences > PHP > PHPUnit の
(*) Path to phpunit.phar のところで、
/usr/local/bin/phpunit-3.7.phar
のようにダウンロードしたファイルのパスを指定した。
その他
composer.json で 下記のように指定しても良いらしい。未確認。
"require-dev": {
"phpunit/phpunit": "3.7.*"
}
今回発生した環境
PhpStorm 7.1.3 Build #PS-133.982
PHPUnit 4.0.14