At the recent International PHP Conference held in Frankfurt, Germany I was able to pick up a copy of Sebastian Bergmann’s “PHPUnit Pocket Guide” a slim pocket guide published by O’Reilly which forms the most complete documentation for PHPUnit. I hesitated before picking up this book, the last “Pocket Guide” I bought covered Python and I found it less than and useful. However, I am very happy with the PHPUnit Pocket Guide, it is well written and easy-to-read documentation for a package which more people should be using.
The book itself is 75 pages long and can easily fit into ones back pocket. After a very brief introduction we quickly move into real life examples and a description of the goals which effected the development of PHPUnit.
What I found enjoyable, was the mixture between real-world examples, Agile development methodologies and program documentation. I have never used PHPUnit style of unit testing before and while I am familiar with the concepts of Agile and Extreme programming, I would have appreciated a bit more Theory. Of course, this is a pocket guide, not “Unit Testing Unleashed” and links are provided to various sources of information on the topic, so there is plenty of information for me to look at.
The pocket guide also covers using PHPUnit with Phing as well as a brief section on PHPUnit and PHP4.
Best of all, this book is totally free and you can download it from the PHPUnit website. Many thanks to Sebastian not only the book, but for bringing a full-featured Unit Testing suite to PHP (yes, I know about SimpleTest, but I’m preferential to PEAR packages).