In this episode we continue to use Test Driven Development (TDD) to drive out the implementation the simple HTTP REST(ish) API microservice in PHP.
We add handling when the database is not available to the endpoint GET to retrieve a book by its ISBN.
We start by refactoring the endpoint code to add different layers (Controller – Business Logic – Book Repository). We then add Unit and Integration tests to ensure our code ensure each part of our application can handle the different exceptions being thrown.
The code produced during this episode can be found on GitHub
During this video we use: