IntelliJ IDEA 2016.3 Help

PHPSpec

File | Settings | Languages and Frameworks | PHP | PHPSpec for Windows and Linux
IntelliJ IDEA | Preferences | Languages and Frameworks | PHP | PHPSpec for OS X
Ctrl+Alt+S

/help/img/idea/2016.3/settings.png

This page is available only when the PHP and PHPSpec plugins are installed and enabled. The plugins are not bundled with IntelliJ IDEA, but they can be installed from the JetBrains plugin repository as described in Installing, Updating and Uninstalling Repository Plugins and Enabling and Disabling Plugins. Once enabled, the plugins are available at the IDE level, that is, you can use it in all your IntelliJ IDEA projects.

Before you start, make sure the PHP interpreter is configured in IntelliJ IDEA on the PHP page, as described in Enabling PHP Support.

On this page, configure installations of the PHPSpec toolset available through configured local and remote PHP interpreters and thus enable behaviour-driven development in IntelliJ IDEA. The page consists of two panes:

PHP interpreters

The central pane of the page shows a list of configured PHP interpreters that are associated with PHPSpec installations. The list contains at least one item (Local) which cannot be removed.

  • To add a remote interpreter to the list, click /help/img/idea/2016.3/new.png on the toolbar of the pane and choose the relevant interpreter in the PHPSpec by remote interpreter dialog that opens. Then specify the details of the PHPSpec installation to use with this interpreter.
  • To remove a remote interpreter from the list, select the relevant interpreter and click /help/img/idea/2016.3/delete.png. The PHPSpec configuration associated with the interpreter is also removed.

See Configuring Remote PHP Interpreters for details.

PHPSpec configuration

ItemDescription
CLI Interpreter In this area, IntelliJ IDEA displays the remote PHP interpreter to use PHPSpec with and the path mappings configured for this interpreter. If the selected remote PHP interpreter is running on a Docker container or in a Vagrant instance, IntelliJ IDEA also displays the path to this container or the Vagrant instance folder which points at the environment you are going to use. See Configuring Remote PHP Interpreters for details.

The field is read-only, to update the chosen interpreter configuration or create a new one, click the /help/img/idea/2016.3/browseButton.png whereupon IntelliJ IDEA brings you to the Interpreters dialog box.

PHPSpec Library In this area, specify the PHPSpec installation to use.
  • In the Path to PHPSpec executable text box, specify the location of phpspec. PHPSpec does not necessarily have to be installed under the current project root. You can type the path manually or click the /help/img/idea/2016.3/browseButton.png button and choose the relevant location in the dialog box that opens.

    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.

  • The Prefix ('spec_prefix'): 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 the /help/img/idea/2016.3/browseButton.png button and choose the file in the dialog box that opens.

    Clear the check box to have PHPSpec use the phpspec.yml or phpspec.yml.distconfiguration file from the project root folder. If no such file is found, test execution fails, therefore it may be more reliable to specify the configuration file explicitly.

See Also

Last modified: 29 November 2016