Unit Testing with phpunit

Published at June 9, 2020 ·  4 min read

In this post I’m going to explain and walk you through how to write unit tests with PHP using phpunit. First step is to add php unit as a requirement in your composer.json file. You can do that by running the following command. composer require --dev phpunit/phpunit Let’s also go ahead and add an autoload entry to the composer file to make things easier, this is what the composer file should look like....