uoz 作業日記


Intellij Ideaでcakehp3のphpunitを動かす



1. Intellij の設定画面を開く

2. Languages & Frameworks > PHP を開く

3. Interpreter: でphpの実行ファイルを選ぶ

4. PHPUnitを選ぶ

5. PHPUnit Library 欄で、User Composer autoloaderを選んで、下の「Path to script」の右の欄にアプリディレクトリ内 vendor/autoload.phpへのパスを入れる

6. Test Runner 欄 で、「 Default configuration file」にチェックし、右のボックスに phpunit.xml.distのパスを入れる


How to configure PhpStorm 10.x to run unit tests in CakePHP 3.x? - Stack Overflow

Without trying to solve your specific error, here's how I have configured PhpStorm.

In Languages & Frameworks > PHP

> Interpreter: Pointing to a local PHP executable
> PHPUnit > PHPUnit Library: Checked Use custom autoloader, pointing to vendor/autoload.php in the app folder.
> PHPUnit > Test Runner: Checked Default configuration file, pointing to phpunit.xml.dist in the app folder.

All paths should be absolute ones!

And that's all, running tests via the file/folder/code context menus Run ... command works just fine.