Features Releases

Rerun Failed PHPUnit Tests in PhpStorm 11

When you have failed PHPUnit tests to fix, it can be painful to have to rerun your whole test suite just to see if a change has fixed that broken test. In PhpStorm 11  you can now rerun only failed tests from within the test runner.

Once you have one (or more) failed PHPUnit tests in the test runner pane, you’ll see that the Rerun Failed Tests icon becomes available in the left hand icon panel.

Re-run Failed Tests

When you use this action, the test running will now only run the tests that failed the last time you ran the test, and not the entire test suite.

It’s worth noting that the run button (above the marked button in the screenshot) will change to run the last run action, in this case Rerun failed tests (you can see the tooltip change when you hover over the button). So you can quickly keep running the action between changes using the default keyboard shortcut.

If you wish to run the entire test suite after running only the failed tests, then simply use the run configuration option from the main menu bar.

Hopefully, this will save everyone some time!

– Gary and the PhpStorm Team

JetBrains

The Drive to Develop

image description