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

About Gary Hockin

Gary Hockin has been creating code to power web applications for 15 years, the last three of them at an extraordinary level. He is handsome, talented, funny and articulate, and also extremely modest. Gary is a valued contributor to Zend Framework 2 and is a member of the community review team. He's married and has two wonderful children, and when he's not coding, writing about code, speaking about code or reading about code, he can usually be found in the pub playing pool.
This entry was posted in Cool Feature, PhpStorm and tagged , , . Bookmark the permalink.