PhpStorm 6.0.1 Web Help

1.0+

Use this dialog box to create a configuration to be used for running unit tests on PHP applications.

PHP unit testing requires the following prerequisites to be fulfilled:

The dialog box consists of the following areas:

Click here for the description of the options that are common for all run/debug configurations.

Test Runner

In this area, specify the unit tests to launch and the command line switches to be passed to the test runner.

ItemDescription
Test scope In this area, specify the location of tests or the configuration file where they are listed.
  • Directory: select this option to have all the unit tests in a directory launched.

    In the Directory text box, specify the directory to search the unit test in. Type the path to the directory manually or click the Browse button browseButton.png and select the desired directory in the Choose Test Directory dialog box, that opens.

  • Class: select this option to have all the unit tests in a test class launched.
    1. In the File text box, specify the file to search the class in. Type the path to the file manually or click the Browse button browseButton.png and select the desired directory in the Choose Test File dialog box, that opens.
    2. In the Class text box, specify the desired class. Type the class name manually or click the Browse button browseButton.png and select the desired class in the tree view, that opens.
  • Method: select this option to have a specific test method launched.
    1. In the File text box, specify the file to search for the test method in. Type the file name manually or click the Browse button browseButton.png and select the desired file in the tree view, that opens.
    2. In the Method text box, specify the desired method.
  • Defined in the configuration file: select this option to have test runner execute the tests from a dedicated XML file. Specify the XML file to use in the Configuration file text box.
Configuration file In this text box, specify the XML file with additional test runner configuration options and possibly definitions of tests to execute.

When such file is specified, its configuration options override the default test runner configuration settings. If you have selected the Defined in the configuration file option in the Test scope area, the tests to execute are also taken from this file.

Type the path manually or click the Browse button browseButton.png and appoint the desired file in the Choose Test File dialog box, that opens.

Bootstrap file In this text box, specify the PHP script to be always executed before launching tests. Type the path manually or click the Browse button browseButton.png and select the desired folder in the dialog that opens.
Test runner options In this text box, specify the test runner switches.

If necessary, click shift-enter-button and type the desired switches in the Command Line Options dialog box. Type each switch on a new line. When you close the dialog box, the specified switches are displayed in the Test runner options text box with spaces as separators.

Command Line

In this area, customize the behavior of the current PHP interpreter by specifying the options and arguments to be passed to the PHP executable file.

ItemDescription
Interpreter options In this text box, specify the options to be passed to the PHP executable file. They override the default behavior of the PHP interpreter and/or ensure that additional activities are performed.

If necessary, click shift-enter-button and type the desired options in the Command Line Options dialog box. Type each option on a new line. When you close the dialog box, they are all displayed in the Command line options text box with spaces as separators.

Custom working directory In this text box, specify the location of the files that are outside the folder with tests and are referenced in your tests through relative paths. Type the path manually or click the Browse button browseButton and select the desired folder in the dialog that opens.

Note

This settings does not block the test execution because the location of tests is always specified through a full path to the corresponding files and/or directories.

Environment variables In this text box, specify the environment variables to run the PHP interpreter with, if applicable. Click the Browse button browseButton.png to the right of the field and configure a list of variables in the Environment Variables dialog box, that opens:
  • To define a new variable, click the Add toolbar button add.png and specify the variable name and value.
  • To discard a variable definition, select it in the list and click the Delete toolbar button delete.png.
  • Click OK, when ready

The definitions of variables are displayed in the Environment variables read-only field with semicolons as separators.

Toolbar

ItemKeyboard shortcutDescription
add Alt+InsertAlt+Insert Click this button to add new configuration to the list.
delete DeleteDelete Click this button to remove the selected configuration from the list.
copy Ctrl+DCtrl+D Click this button to create a copy of the selected configuration.
settings Edit DefaultsClick this button to edit the default configuration templates. The defaults are used for the newly created configurations.
add add UpUp
DownDown
Use these buttons to move the selected configuration up and down in the list. The order of configurations in the list defines the order, in which configurations appear in the Run/Debug drop-down list on the main toolbar.

Common options

ItemDescription
Defaults This node in the left-hand pane of the dialog box contains the default run/debug configuration settings. Select the desired configuration to change its default settings in the right-hand pane. The defaults are applied to all newly created run/debug configurations.
Temporary configurations limitSpecify here the maximum number of temporary configurations to be stored and shown in the Select Run/Debug Configuration drop-down list.
Before launchIn this area, specify the actions to be performed prior to executing the current run/debug configuration.
ItemKeyboard shortcutDescription
addAlt+InsertAlt+Insert Click this button to add one of the tasks to be executed prior to launching the application. The possible tasks are:
  • Run External tool: Add this task to have PhpStorm launch the specified third-party tool prior to running or debugging. To appoint a tool to launch, select it in the External Tools dialog box that opens.
  • Run Phing target: Add this task to execute the specified Phing target prior to running or debugging. To appoint a Phing target, click the Browse button browse and select the desired target in the Choose Phing Target to Execute dialog box, that opens.
deleteAlt+DeleteAlt+Delete Click this button to remove selected task from the list.
edit1EnterEnter Click this button to open the selected task for editing.
arrowUp or arrowDownAlt+UpAlt+Up or Alt+DownAlt+Down Click these buttons to move the selected task one line up or down.

Note that Before launch actions are performed in the order they are specified in the run/debug configuration dialog.

Show this pageSelect this check box to always show the Edit Run/Debug Configuration dialog prior to launching the current run/debug configuration.
If this check box is not selected, run/debug configuration will be launched silently.

See Also

Concepts:

Procedures:

Reference:

Web Resources: