PhpStormでPHPUnitを実行してみる
PhpStormでPHPUnitを実行してみる。
PHPUnitの設定
PHPUnitをインストールし、
$ sudo yum -y install php-phpunit-PHPUnit
$ cd /vagrant/sample $ mv phpunit.xml.dist phpunit.xml
PhpStormの設定(インタプリタの追加)
[Languages & Frameworks]-[PHP]で、Interpretersの画面を開く。
[Vagrant]を選択し、Vagrantのフォルダを設定する。
以上で、インタプリタが追加される。
PhpStormの設定(PHPUnitの設定)
[Languages & Frameworks]-[PHP]-[PHPUnit]で、[+]ボタンを押し、 [By Remote Interpreter]を選択する。
先ほど追加したインタプリタを選択する。
[Default configuration file]にphpunit.xmlのパスを設定する。
PhpStormの設定(Runの追加)
[Run]-[Edit Configurations]を選択し、
PHPUnitを追加する。
Test Runnerは「Defined in the configuration file」にする。