Many of our current existing tests for the Laravel API Controllers are poorly named, like testShowGroceryItem or testShowGroceryItemUnauthorized; to make debugging failed tests easier, backend tests should follow this naming convention: methodUnderTest_ScenarioName_ExpectedOutcome.
For example, the following test would be a good name for an alternative to testShowGroceryItemUnauthorized: show_unauthorizedUser_returns403Error.
By adopting this naming convention, we can ensure our test suite is easier to understand and maintain.
Many of our current existing tests for the Laravel API Controllers are poorly named, like
testShowGroceryItemortestShowGroceryItemUnauthorized; to make debugging failed tests easier, backend tests should follow this naming convention:methodUnderTest_ScenarioName_ExpectedOutcome.For example, the following test would be a good name for an alternative to
testShowGroceryItemUnauthorized:show_unauthorizedUser_returns403Error.By adopting this naming convention, we can ensure our test suite is easier to understand and maintain.