Create Simple Tests for Drupal Features
This article covers how to use the SimpleTest framework with a feature made using the Features module. Most of the advice here applies to anyone who is just getting started with SimpleTest and Drupal automated testing.
Since the Meetings module is almost ready for a stable release, I was forced to quickly realize how important a testing suite is. Until the module has a wide user base who is willing to test the module for me, it is up to me to do all the testing. Considering all the different states the module can be in (organic groups enabled, meeting owner logged in, various permissions, etc.) this quickly becomes an overwhelmeing task.
I dove into the SimpleTest framework to automate my tests in Drupal. It’s a very robust set of tools and it doesn’t take too long to get started with. Unfortunately, I got caught up on a few small points that I ended up wasting hours on. It was particularly difficult for me because I was releasing a feature, not a standard module. The differences are small, but they were enough to slow me down for a while.
After installing SimpleTest, patching Drupal 6.x core, and installing the Examples module, I started reading through the fantastic SimpleTest tutorial. Below are the “gotchas” that I encountered that prevented me from actually writing tests.
Read More