I’ve been using Drupal now for a couple of months, ever since I started my new job, and the other day got my first chance to start writing a custom module.

I was keen to use a TDD approach, but wasn’t sure how well this would play with Drupal. The SimpleTest module looked pretty good but in the end I went with PHPUnit, mainly because I’d used it before.

After a bit of research I came across a this post explaining how to get PHPUnit set up to play nicely with Drupal 6: http://kristiannissen.wordpress.com/2009/12/08/drupal-6-phpunit-testing-setup/

It worked like a charm :) So, just for good measure, I created a project template containing the unittests folder and necessary include files and stuck it on GitHub: http://github.com/ianoxley/drupal-phpunit-template