
If the Non-installed Composer packages inspection is enabled, IntelliJ IDEA 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 IntelliJ IDEA on the PHP page, as described in Configuring Local PHP Interpreters and Configuring Remote PHP Interpreters. Open the Marketplace tab, find the PHP plugin, and click Install (restart the IDE if prompted).


Press Ctrl+Alt+S to open the IDE settings and select Plugins. The PHP plugin is available only in IntelliJ IDEA Ultimate. This functionality relies on the PHP plugin, which you need to install and enable. IntelliJ IDEA supports unit testing of PHP applications through integration with the PHPUnit testing framework.
