PHPUnit 6 and PhpStorm 2017.1

PhpStorm 2017.1 comes with support for the latest version of the market-leading unit testing framework – PHPUnit 6. There have been a few significant changes that needed us to tweak PhpStorm’s support for PHPUnit, and these will be available in 2017.1.

PHPUnit’s code is now namespaced, and PhpStorm understands that and provides the completion you would expect. We’ve also included a new file template for PHPUnit 6 unit tests which you can find in the settings under Editor | File and Code Templates | PHPUnit 6 Test.

phpunit-settings

To make it even easier, we’ve also added a new checkbox “Create Test in PHPUnit 6+ format”. So you can specify the test format directly during a test creation in the Create New PHPUnit Test window.

Phpunit6

It’s also worth noting that PHPUnit 6 dropped support for any of the PHP 5 branches, so if you’re not using PHP 7 yet, there really is no better time to upgrade.

– Gary and The PhpStorm Team

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, Newsletter. Bookmark the permalink.