- Open preferences pane (
Cmd+,
) - Go to
Languages & Frameworks
>PHP
. - On
CLI Interpreter
, click the...
button. - Click
+
andFrom Docker, Vagrant, VM, Remote...
. - Select
Docker
, one of the images being used for the project. ThenOK
. - Click
OK
again and the CLI Interpreter setting will be complete. - Still on the
Languages & Frameworks
>PHP
, fix theDocker container
path. - On
Docker container
, click...
button, remove the current volume binding and create a new correct one. - In my case it was:
/var/www/html
- On clicking
OK
, thePath mappings
section will automatically correct itself with those values.OK
.
- On the settings window, go to
Language & Frameworks
>PHP
>Test Frameworks
. - Click
+
, selectPHP Unit by remote interpreter
, select theCLI Interpreter
configured before.OK
. - Check that the
vendor
folder exists. Else, runcomposer install
. - Select
Use Composer autoloader
and fill thePath to script
with the appropriate value. In my case:/var/www/html/vendor/autoload.php
(use the full path). - In Test Runner, check
Default configuration file
and use the full path of the phpunit.xml. My case:/var/www/html/phpunit.xml.dist
. OK
to close the Settings window.
- Menu
Run
, itemEdit Configurations...
. - Click
+
,PHP Unit
. - Name it whatever you want.
PHPUnit
. - Test scope:
Defined in the configuration file
. - Finish!