This is a simple example of unit testing in PHP with PHPUnit.
Please feel free to download this repository and give the unit tests a try.
You can build upon this further after cloning the repository and adding more tests and methods as you see fit.
Try taking a test driven development (TDD) approach to adding a new method to Average class for calculating the mode by writing a test first.
Clone this repository and then run Composer:-
composer install
You will then be able to run the unit tests using:-
./vendor/bin/phpunit