Watch 5 New Videos on PHPUnit and Dependency Injection (1 FREE!)
In this video, we install PHPUnit - the tool we’ll use to run PHP unit tests - on a Mac.
Here we install PHPUnit on Windows using the PEAR package manager, and we do a short showdown on what make Packagist a better solution for most scenarios.
Now that we have PHPUnit set up, we set up a configuration file to tell PHPUnit where to find tests.
We’ve run into interfaces a couple of times so far (interfaces are like scaffolding for any child classes), and in this video we discuss the advantages of using interfaces for PHPUnit tests.
In this video we briefly talk about what dependency injection is and why it makes sense, particularly for testable code. We also update our code to use the interfaces we talked about in the previous video.