Posted on Sep21st2021 by Matthias Noback I've mentioned this several times without explaining: the rule that every class should have a test, or that every class method should have a test, does not make sense at all.

The programmer's job is to extract those classes from the world of ideas and turn them into code that we can run on our computers.

Once we have found such a class (eureka!) we know, because of our team rule, that we have to now also create a test class for it.

Maybe not, because B's behavior is indirectly covered by the test we already have for class A. Maybe yes, because I can mock B and test A and B separately.
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