Mattieu Napoli shows how you can use non breaking spaces to make long test function names more readable.
Yes. This article is about using non-breakable spaces to name tests. And the fact that it’s awesome. And why you should use them too.
public function test a user can add a product to a wishlist()
The code above is valid PHP code and works. Non-breaking spaces (aka in HTML) look like spaces in editors but are actually interpreted like any other character by PHP.
It’s cool that it works, but I’m not really a fan of this. I very much prefer how test runners like
jest go about this by passing the name of the test to a function so you can use spaces.