Introduction
When we write a client to integrate an API in our systems it is important to test it to be sure we can handle every possible response.
Guzzle client provides a very simple way to mock external APIs responses: Guzzle Mock Handler. This tool provides a mock handler
that can be used to fulfill HTTP requests with a response or exception by shifting return values off of a queue.
Why do I need to test?
Everyone who works in software development has stumbled upon software testing.
Why should a developer know anything about testing?
Well, software testing is a valuable asset and a big part of development: it does not only test the application, it also teaches to think outside the box and to write code with quality in mind.
Software testing is not finding bugs
The goal of software testing is not only to find bugs and “break things”. Testing can range from a pure exploration of functionalities to a deep understanding of the tested application. Testing can give an idea of what, why and how the application is tested together with the guiding concept of quality.