Greg Tyler

Weeknotes: 2nd March 2020

Published on 7th March 2020

This week I wrote controller unit tests

This might not sound like much of an achievement, but it’s been a big gap in our testing coverage.

The limiting factor has been how to mock out services: we want to ensure the email sender is used, but not actually send it.

A few things have made this easier: enabling autowiring, a better understanding of Symfony and its configuration options, and a real need for these tests.

As far as I’m aware, there’s now nothing we can’t test. This is great news for our test confidence, but also our coverage measurement: if we can cover everything in unit tests, we can measure it easily. Up until now we’ve been limited to end-to-end testing, which is hard to measure.