As developers, we spend a lot of time testing the code that we’ve written. What if instead of doing the same manual testing over and over again, we used a tool that would allow us to write tests that check an input with an expected output.
Unit testing is a testing method where individual units of source code are tested to determine whether they are fit for use. A unit test generally tests a single class so we can isolate side effects in our tests.
There are many other testing frameworks for testing in PHP, but PHPUnit is the de-facto testing framework for PHP.