Testing
PhpStorm supports all major PHP testing frameworks: PHPUnit, Pest, Behat, Codeception, and PHPSpec. If you are using these frameworks, you can:
Generate unit tests from within PhpStorm.
Use PhpStorm to run and rerun tests from folders, subfolders, specific test classes, test methods, or PHPUnit data sets. You can also enable an autotest-like runner to automatically restart tests in the current run configuration every time you change the related source code.
Track and explore test results in a dedicated Test runner tool window.
tip
Note that, to run tests, you need to have a local or remote PHP interpreter configured in PhpStorm.
PhpStorm enables support for the test frameworks used in the project automatically if you install project dependencies with Composer. If a project contains multiple composer.json
files, each Composer-managed subdirectory will have its own configurations for test frameworks. To customize the test framework configuration, or enable support manually, go to the Test Frameworks settings page.
For framework-specific guides, see: