PHPUnit: A second look


Somewhere in 2007 I had a deep dive into PHPUnit, and there were a couple of things that bugged me.

Looking into it again, it turns out that since then everything has been fixed, making it perfect for integrating it into sabredav. Most of the protocol-level WebDAV stuff is all tested with litmus, but having good unit tests will help ensuring a high quality of the inner business logic. Already it has identified 2 spelling mistakes :).

My highlights:

  • No need to write 'TestSuites' anymore.
  • A 'bootstrap' setting. This file contains all the application specific logic to setup the test.
  • The Code coverage analysis is perfected.
  • The ability to specify which directories to include in the code coverage.
  • As a bonus, all these settings can be specified through a single XML configuration file. This way I can simply tell users to run 'phpunit --configuration=config.xml' and they're off..