Source: matthiasnoback.nl

Unit test naming conventions

Category: PHP

Posted on Jun23rd2020 by Matthias Noback PHPStorm IDE from the last version gives for you ability to generate a TestCode and they do not use an underscore too: I opened a popular frameworks (Symfony, Laravel, YII2, CodeIgniter4) test folders in Github and then I opened a popular PHP library and also do not find underscore usage in test and @test annotation.

You might as well write something like this: In fact, there are test frameworks that let you write tests like this.

Starting test method names with it_ can be very helpful to get you in this "specification" mindset.

Copyright © 2011-2020 - Matthias Noback - Powered by Sculpin and Bootswatch - Privacy policy
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners