

On the Test Frameworks page that opens, click in the central pane and choose the configuration type from the list: In the Settings dialog ( Ctrl+Alt+S), go to PHP | Test Frameworks. PhpStorm will create the local framework configuration on the Test Frameworks page and the PHPUnit run/debug configuration.

Store the phpunit.xml or configuration file under the project root. In the case of remote PHP interpreters, manual PHPUnit configuration is required. If you use a local PHP interpreter, PhpStorm performs initial PHPUnit configuration automatically. Integrate PHPUnit with a PhpStorm project Press Alt+Enter and select whether you want to install a specific dependency or all dependencies at once.Ĭlick next to the package record in the composer.json editor gutter to jump to the corresponding Settings page and configure PHPUnit manually. If the Non-installed Composer packages inspection is enabled, PhpStorm will highlight the declared dependencies that are not currently installed. Press Ctrl+Space to get code completion for the package name and version.Ĭlick the Install shortcut link on top of the editor panel. Inside composer.json, add the phpunit/phpunit dependency record to the require or require-dev section. If you only need to run PHPUnit tests and you do not need any coding assistance, you can save phpunit.phar outside the project.ĭownload and install phpunit.phar with Composer If you need full coding assistance in addition to the ability of running PHPUnit tests, store phpunit.phar under the root of the project where PHPUnit will be later used. Download and install phpunit.phar manuallyĭownload phpunit.phar from the PHPUnit Official website and save it on your computer: Download and install PHPUnitīefore you start, make sure Composer is installed on your machine and initialized in the current project as described in Composer dependency manager. Make sure the PHP interpreter is configured in PhpStorm on the PHP page, as described in Configure local PHP interpreters and Configure remote PHP interpreters. PhpStorm supports unit testing of PHP applications through integration with the PHPUnit testing framework.
