E-Ink News Daily

Back to list

Using non-breakable spaces in test method names

The author describes using non-breaking spaces in PHP test method names for improved readability, such as test a user can add a product to a wishlist. What started as a joke at Wizaplace became a long-term practice after a controlled experiment proved it effective. The approach prioritizes human readability over strict PSR-2 compliance.

Background

PHP allows non-breaking spaces in identifiers, making them valid identifiers. Test naming conventions often prioritize readability, and this unconventional approach has gained traction in some PHP communities.

Source
Lobsters
Published
Sep 20, 2026 at 06:04 PM
Score
5.0 / 10