Features Releases

Test methods generation

PhpStorm 2017.3 makes it easier to create tests with all supported test frameworks.

Previously available for PHPUnit tests only, test file templates will now assist you in creating Codeception Unit, Codeception Functional, and PHPSpec Specification tests.

You can choose the desired template by selecting New | PHP Test in the Project view:


Alternatively, you can invoke the Test action from within a class or a method. Simply press Shift+Command+A (Shift+Control+A on Windows) and then search for “Test”:


We’ve also reworked the Create New PHP Test dialog. It now allows you to switch between the test file templates as well as to choose specific class methods to create tests for:


The test class will be generated within the framework-specific class namespace and will contain stubs for the test methods:


In all likelihood you will want to customize the content a template produces. Do so by navigating to Settings | Editor | File & Code Templates. Here, you can locate the test file templates on the Files tab, and test method code templates – on the Code tab:


Stay tuned for more updates!

Your JetBrains PhpStorm Team
The Drive to Develop

image description