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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners