- 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
OKagain and the CLI Interpreter setting will be complete. - Still on the
Languages & Frameworks>PHP, fix theDocker containerpath. - 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 mappingssection 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 Interpreterconfigured before.OK. - Check that the
vendorfolder exists. Else, runcomposer install. - Select
Use Composer autoloaderand fill thePath to scriptwith the appropriate value. In my case:/var/www/html/vendor/autoload.php(use the full path). - In Test Runner, check
Default configuration fileand use the full path of the phpunit.xml. My case:/var/www/html/phpunit.xml.dist. OKto 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!