for Windows and Linux
for macOS
The page is available only when the PHP plugin is enabled. The plugin is not bundled with IntelliJ IDEA, but it can be installed from the JetBrains plugin repository as described in Installing, Updating and Uninstalling Repository Plugins and Enabling and Disabling Plugins.
Use this page to integrate PHP-specific testing frameworks with IntelliJ IDEA in the current project.
With IntelliJ IDEA, you can run a debug PHPUnit
, Behat
,
Codeception
, and PHPSpec
tests.
What does the Test Frameworks page show?
The page consists of two panes:
- The central pane shows existing configurations of test frameworks for different interpreters.
- The contents of the right-hand pane depend on the test framework and the type of the selected interpreter.
How do I configure a test framework in a project?
-
Step 1: Choose how you will use the framework
Click
and choose the relevant configuration type from the list:
You can configure any test framework to use with a local or remote PHP interpreter. PHPUnit can also be configured to run by a Web Server via HTTP.
-
Step 2: For a remote configuration, choose the PHP interpreter
In the dialog box that opens, choose one of the configured PHP interpreters:
To use PHPUnit with a web server, choose the target deployment configuration:

In local configurations the default project PHP interpreter is used, see Default project CLI interpreters.
-
Step 3: In the right-hand pane, choose where to take the test framework from
For Behat, PHPSpec, and Codeception, type the path to the framework executable.
For PHPUnit, specify the type of framework installation you are using, the available options are composer autoloader (autoload.php), orphpunit.phararchive, orPEAR.
-
Step 4: Check the chosen remote PHP interpreter, path mappings, or target deployment server
For remote configurations, the pane also shows the chosen PHP interpreter and the path mappings or the target deployment server. -
Step 5: Optionally
Specify the configuration file. For PHPUnit, you can also specify a bootstrap file to use.
PHPUnit
In this pane, configure installations of PHPUnit to be used with PHP interpreters.
PHPUnit Library
In this area, specify the type of PHPUnit installation. The available options are:
| Use Composer autoloader |
Choose this option to run PHPUnit installed by
the Composer Dependency Manager.
The package is retrieved and loaded by the autoload.php file from the vendor folder.
autoload.php in the Path to script text box.
|
| Path to phpunit.phar |
Choose this option to run PHPUnit from the .phar archive.
|
| Load from include path | Choose this option to have IntelliJ IDEA run the PHPUnit from PEAR configured as an include path on the PHP page of the Settings / Preferences Dialog. |
CLI Interpreter
This area shows:
- The remote PHP CLI Interpreter to use PHPUnit with.
- The Path Mappings between your local sources and the sources inside the Vagrant instance, or the Docker container, or on the remote host.
- The Docker container settings that will be used to start the container from an image. These settings may include the volume configuration, the exposed port, the network, etc.
next to the field in question and specify the settings manually.
See Configuring Remote PHP Interpreters for details.
The CLI Interpreter field is read-only. Click
to update the chosen interpreter
in the Interpreters dialog box.
The area is shown only for PHPUnit by Remote Interpreter configurations.
Web Server
The read-only field shows the deployment configuration to use PHPUnit with,
see Deployment. Working with Web Servers for details.
The field is available only for PHPUnit by Web Server configurations.
Test Runner
In this area,
appoint the configuration XML file to use for launching and executing scenarios.
By default, PHPUnit looks for a phpunit.xml configuration file in the project root folder or in the config folder.
You can appoint a custom configuration file.
You can also type the path to a bootstrap file
to have PHP script always executed before launching tests. In the text box, specify the location of the script. Type the path manually
or click
and select the desired folder
in the dialog that opens.
| Default configuration file |
Select this check box
to specify your own XML configuration file.
This file will be later used as default in all PHPUnit run/debug configurations.
In the text box, specify the location of the configuration file to use. Type the path manually
or click
Clear the check box
to have PHPUnit use the |
| Default bootstrap file |
Select this check box
to have PHP script always executed before launching tests. In the text box, specify the location of the script. Type the path manually
or click and select the desired folder
in the dialog that opens.
|
Behat
This pane is available only when the Behat Support plugin is installed and enabled
on the Plugins page as described
in Installing, Updating and Uninstalling Repository Plugins and Enabling and Disabling Plugins.
This pane is available only when the Behat Support plugin is installed and enabled on the Plugins page as described in Installing, Updating and Uninstalling Repository Plugins and Enabling and Disabling Plugins.
In this pane, configure installations of the Behat
framework
available through configured local and remote PHP interpreters.
CLI Interpreter
This area shows:
- The remote PHP CLI Interpreter to use Behat with.
- The Path Mappings between your local sources and the sources inside the Vagrant instance, or the Docker container, or on the remote host.
- The Docker container settings that will be used to start the container from an image. These settings may include the volume configuration, the exposed port, the network, etc.
next to the field in question and specify the settings manually.
See Configuring Remote PHP Interpreters for details.
The CLI Interpreter field is read-only. Click
to update the chosen interpreter
in the Interpreters dialog box.
The area is shown only for Behat by Remote Interpreter configurations.
Behat Library
In this area, specify the Behat installation to use.
| Path to Behat executable |
In this text box, specify the location of the behat.phar archive or the folder with the Behat executable file.
Behat does not necessarily have to be installed under the current project root. You can type the path manually
or click and choose the relevant location in the dialog box that opens.
|
| Behat releases |
Click this link to navigate to the Behat repository on github
where you can choose the relevant version of behat.phar archive.
|
| Behat version |
This read-only field shows the version of the specified Behat installation.
IntelliJ IDEA detects the version when you click the Refresh icon .
The default value is Not installed.
|
Test Runner
In this area,
appoint the configuration .yml file to use for launching and executing scenarios.
By default, Behat looks for a behat.yml configuration file in the project root folder or in the config folder.
You can appoint a custom configuration file.
| Default configuration file |
Select this check box
to specify your own .yml configuration file.
This file will be later used as default in all Behat run/debug configurations.
In the text box, specify the location of the configuration file to use. Type the path manually
or click
Clear the check box
to have Behat use the |
This pane is available only when the Behat Support plugin is installed and enabled on the Plugins page as described in Installing, Updating and Uninstalling Repository Plugins and Enabling and Disabling Plugins.
Codeception
This pane is available only when the Codeception Framework plugin is installed and enabled
on the Plugins page as described
in Installing, Updating and Uninstalling Repository Plugins and Enabling and Disabling Plugins.
This pane is available only when the Codeception Framework plugin is installed and enabled on the Plugins page as described in Installing, Updating and Uninstalling Repository Plugins and Enabling and Disabling Plugins.
In this pane, configure installations of the Codeception
framework
available through configured local and remote PHP interpreters.
CLI Interpreter
This area shows:
- The remote PHP CLI Interpreter to use Codeception with.
- The Path Mappings between your local sources and the sources inside the Vagrant instance, or the Docker container, or on the remote host.
- The Docker container settings that will be used to start the container from an image. These settings may include the volume configuration, the exposed port, the network, etc.
next to the field in question and specify the settings manually.
See Configuring Remote PHP Interpreters for details.
The CLI Interpreter field is read-only. Click
to update the chosen interpreter
in the Interpreters dialog box.
The area is shown only for Codeception by Remote Interpreter configurations.
Codeception Library
In this area, specify the Codeception installation to use.
| Path to Codeception executable |
In this text box, specify the location of the codeception.phar archive or the folder with the Codeception executable file.
|
| Codeception releases |
Click this link to navigate to the Codeception repository on github
where you can choose the relevant version of codeception.phar archive.
|
| Codeception version |
This read-only field shows the version of the specified Codeception installation.
IntelliJ IDEA detects the version when you click the Refresh icon .
The default value is Not installed.
|
Test Runner
In this area,
appoint the configuration .yml file to use for launching and executing scenarios.
By default, Codeception looks for a codeception.yml configuration file in the project root folder.
You can appoint a custom configuration file.
| Default configuration file |
Select this check box
to specify your own .yml configuration file.
This file will be later used as default in all Codeception run/debug configurations.
In the text box, specify the location of the configuration file to use. Type the path manually
or click
Clear the check box
to have Codeception use the |
This pane is available only when the Codeception Framework plugin is installed and enabled on the Plugins page as described in Installing, Updating and Uninstalling Repository Plugins and Enabling and Disabling Plugins.
PHPSpec
This pane is available only when the PHPSpec BDD Framework plugin is installed and enabled
on the Plugins page as described
in Installing, Updating and Uninstalling Repository Plugins and Enabling and Disabling Plugins.
This pane is available only when the PHPSpec BDD Framework plugin is installed and enabled on the Plugins page as described in Installing, Updating and Uninstalling Repository Plugins and Enabling and Disabling Plugins.
In this pane, configure installations of the PHPSpec
toolset
available through configured local and remote PHP interpreters.
CLI Interpreter
This area shows:
- The remote PHP CLI Interpreter to use PHPSpec with.
- The Path Mappings between your local sources and the sources inside the Vagrant instance, or the Docker container, or on the remote host.
- The Docker container settings that will be used to start the container from an image. These settings may include the volume configuration, the exposed port, the network, etc.
next to the field in question and specify the settings manually.
See Configuring Remote PHP Interpreters for details.
The CLI Interpreter field is read-only. Click
to update the chosen interpreter
in the Interpreters dialog box.
The area is shown only for PHPSpec by Remote Interpreter configurations.
PHPSpec Library
In this area,
specify the PHPSpec installation to use.
| Path to PHPSpec executable |
In this text box, specify the location of phpspec.
PHPSpec does not necessarily have to be installed under the current project root.
If no path to PHPSpec is specified for a Local interpreter, IntelliJ IDEA does not provide full support of PHPSpec, for example, it does not show suggestion for code completion and does not resolve references. |
| Prefix ('spec_prefix') |
This read-only field
shows the namespace prefix for specifications.
IntelliJ IDEA detects spec_prefix from the configuration file specified in the Default Configuration File field.
The default value is spec.
See PHPSpec Configuration: PSR-4 and
PHPSpec Configuration: Spec and Source Location
for details.
The field is shown for Local configurations only. |
Test Runner
In this area,
appoint the configuration .yml file to use for launching and executing specifications.
By default, PHPSpec looks for a phpspec.yml or a phpspec.yml.dist configuration file in the project root folder.
You can appoint a custom configuration file.
| Default configuration file |
Select this check box
to specify your own .yml configuration file.
This file will be later used as default in all PHPSpec run/debug configurations.
In the text box, specify the location of the configuration file to use. Type the path manually
or click
Clear the check box
to have PHPSpec use the |
This pane is available only when the PHPSpec BDD Framework plugin is installed and enabled on the Plugins page as described in Installing, Updating and Uninstalling Repository Plugins and Enabling and Disabling Plugins.
See Also
Procedures:
- Testing with PHPUnit
- Testing with Behat
- Testing with PHPSpec
- Testing with Codeception
- Testing
- Testing PHP Applications
Reference:

.
The default value is Not installed.