PHPUnit will run every file ending with Test.php in the selected directory branch. Select the directory containing the modules unit tests.Test Scope: select the Directory option.Give the run configuration a descriptive name for example, Example_Module Unit Tests.Check the Use alternative configuration file checkbox.Test Scope: select the Defined in the configuration file radio button.Give the run configuration a descriptive name for example All Unit Tests.Click the + symbol on the top right and select PHPUnit.ĭepending on what tests should be included in the run configuration, the next steps differ.Select the Run > Edit Configurations action from the top menu.Here we just show one of the option.Īll start by creating a new run configuration. There are many ways to create run configurations in PhpStorm. The final step is to create a run configuration to execute the desired tests. Please refer to the PhpStorm documentation for further information on Configure a test framework in a project. Doing this step makes creating temporary run configurations more convenient. Optionally select the dev/tests/unit/ file as the Default configuration file.Select the vendor/autoload.php file in your Magento 2 installation.Click the Use Composer autoloader option.Configuring PHPUnitĪfter configuring the interpreter, the next step is to set up the PHPStorm preferences for how to execute PHPUnit. Please be aware that the details on configuring the PHP interpreter might vary between PhpStorm versions. It is also possible to configure a remote PHP interpreter, which is a common setup when working with Vagrant or Docker based development environments. Please refer to the PhpStorm documentation for further information on how to configure a local PHP interpreter. Then, click the + (add) button in the top right to select the desired PHP binary on your file system. If you can not select a PHP interpreter because the dropdown is empty, you can add a one by clicking on the button with the three dots beside the dropdown. In the PhpStorm preferences, select the PHP interpreter PhpStorm should use to run tests with. Running tests in PhpStorm requires following steps to setup the system.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |