PhpStorm 6.0.1 Web Help

You can run your tests (test cases, test suites, etc.) using run/debug configurations, in the way similar to running ordinary applications. PhpStorm provides a framework for creating special run/debug configurations for testing purposes, where a test can be specified as a target.

In addition to the regular test configuration creation, PhpStorm supports creating test configurations for specific targets, for example for all tests in a file, class, or directory.

With PhpStorm you can also create configurations for running PHP unit tests locally or on a remote server.

To create a test configuration
  1. Open the Run/Debug Configuration dialog box by doing one of the following:
    • On the main menu, choose Run | Edit Configurations.
    • Press RunConfigurationRunConfiguration and choose Edit Configuration on the context menu.
  2. Click the Add button add on the toolbar and select the desired configuration type:
    • To have unit tests executed locally, choose PHPUnit.
    • For remote test execution, choose PHPUnit on Server.
  3. In the dialog box that opens, specify the test scope, configuration parameters, and activities to perform before test execution. Apply the changes and close the dialog box.
To create a test configuration for a specific target
  1. In the Project tool window, right-click the desired test directory, individual file, or class.
  2. On the context menu of the selection, choose Create Run configuration. PhpStorm displays a list of suggested configurations.

    create_test_configuration.png

    Each configuration has the name of the selected target and is supplied with an icon indicating its type.
    • create_test_config_local.png - the icon marks a PHPUnit configuration for running tests locally.
    • create_test_config_remote.png - the icon marks a PHPUnit on Server configuration for running tests remotely.
    Choose the configuration of the desired type.
  3. In the Run/Debug Configuration dialog box that opens, specify the configuration parameters and activities to perform before test execution. Apply the changes and close the dialog box.

See Also

Procedures:

Reference:

Web Resources: