Codeception Support Comes to PhpStorm 2017.1
The Codeception test framework is a nice way of organizing your Unit, Integration and Acceptance tests under one roof, and PhpStorm 2017.1 brings support for Codeception into your favorite IDE.
While Codeception uses PHPUnit under the hood to run its tests, it’s been fiddly (at best) to get Codeception tests to run quickly and easily in PhpStorm, until now. PhpStorm 2017.1 brings a Codeception specific test runner that makes it much simpler to configure your Codeception test runner, and to run specific batches of tests right from within your IDE.
First, we need to tell PhpStorm where to find the Codeception executable on our system. In my case, I’ve installed Codeception using Composer, so it’s in the `vendor\bin` folder. You can find these settings under Languages & Frameworks | PHP | Codeception.
Next, we just create a run configuration using the Codeception type from the run configuration drop-down menu in the toolbar. The easiest way to configure the runner is by using the Type option – you can run just your Acceptance, Integration or Unit tests, or run all tests. I’m running just the Acceptance tests.
If you only want to run the tests in the file that you are in, you don’t need to create a full configuration. If Codeception is configured correctly in PhpStorm, you can just right-click anywhere in the file and select Run, and then click the filename with the Codeception logo next to it.
Now, we can run the test using either the play button next to the configuration drop-down or by using the CTRL+R shortcut. As with the other test runners, we get all the benefits of running tests inside PhpStorm, including click-through to failed or skipped tests. It’s also worth noting that like all the test runners in PhpStorm, the Codeception runner works for both local configuration and remote configurations (including Vagrant and Docker).
I’ve started playing with Codeception again after a number of years not using it, and it seems to have improved a lot since I last looked at it. I’m looking forward to working with Codeception in PhpStorm. As with all the improvements, give it a go, and let us know what you think.
– Gary & The PhpStorm Team
Subscribe to Blog updates
Thanks, we've got you!
PhpStorm 2023.2 Beta
In this build, we’ve added new inspections for PHP assertions and revised the integration with third-party quality tools.
PhpStorm 2023.2 EAP #6
This build brings improvements for generating PHPDocs, support for Laravel Pint, a single point of access to all PHP framework plugins, and much more!
AI Features in PhpStorm: PhpStorm 2023.2 EAP #5
The next EAP build for PhpStorm 2023.2 is now available, and it’s an exciting one! It is the first build to include features leveraging the enormous potential of generative AI and large language models (LLMs). Our Early Access Program (EAP) allows you to try new features from the upcoming PhpStor…
PhpStorm 2023.2 EAP #4
This build includes a bunch of usability improvements, such as abilities to pin Run configurations and sort files by modification time in the Project view. The EAP allows you to try new features from the upcoming PhpStorm version, 2023.2. EAP builds are free to use and you can install them side b…