LoginSignup
7
7

More than 5 years have passed since last update.

PhpStorm の PHPUnit が実行できない時の対処法

Posted at

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

7
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7