Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Sameer Nyaupane:
PHP Test Driven Development Part 2: Unit Testing
Dec 18, 2017 @ 13:39:07

On the HackerNoon site Sameer Nyaupane has posted the second part of his series on test-driven development in PHP focusing on unit testing and sharing some best practices around creating effective tests.

All right, welcome to part 2 of “PHP Test Driven Development” series. Today we will go through the PHPUnit setup in detail.

We will be using the Laravel framework to make it easier for us to get started. It will also help me to show you how to do testing for real life applications. I will assume you have used Laravel before. This will help me focus on the testing side and make the tutorial easier to grasp.

The tutorial then walks you through the setup of a new Laravel project and the inclusion of PHPUnit before getting into the tests themselves. It also shares a PHPUnit configuration example and the creation of an example tests with a simple assertion.

tagged: tutorial testdriven development tutorial series part2 unittest

Link: https://hackernoon.com/php-test-driven-development-part-2-unit-testing-c327ba3fbf14