Juan Treminio has a series of new posts over on his site - a four part series covering unit testing with PHPUnit. There's three parts to the series (right now) covering everything from an intro to PHPUnit out to some more advanced techniques.
For months now I have been telling myself I would create an in-depth, multi-part series of articles that would take a developer from being a complete newbie at testing to have them mocking classes left and right and asserting until the break of dawn. This series will introduce you to the core concepts of testing. It will tell you why statics are bad, why dependency injection is king, what the difference between a mock and a stub is and how to love the red and green bar.
The four parts of the series he's posted are:
- Unit Testing Tutorial Part I: Introduction to PHPUnit
- Unit Testing Tutorial Part II: Assertions, Writing a Useful Test and @dataProvider
- Unit Testing Tutorial Part III: Testing Protected/Private Methods, Coverage Reports and CRAP
- Unit Testing Tutorial Part IV: Mock Objects, Stub Methods and Dependency Injection