testing

First Look at SimpleTest in Core

I had a little free time today, so I took a look at the new SimpleTest integration for Drupal 7. The SimpleTest framework now comes as a core module, which is a fantastic choice for growing a testing culture. I have only been keeping half-an-eye on the evolution of the testing framework, but I get the impression it bears only a passing resemblance to the original SimpleTest framework.

It looks like you need cURL working with your PHP. Since my dev machine is running XAMPP, all I needed to do was uncomment the line
extension=php_curl.dll

SimpleTest tips

Enough ranting about testing, here are some useful tips for enjoying SimpleTest.

Joys of Unit Testing

Back when I was a java programming I fell in love with test-first development, where you write you tests a little in advance of coding in a feature (or at least in concurrence with). I could babble on about all the benefits the approach brings, but the key to using it is that it has to be quick and easy. Unfortunately, with Drupal it is neither. But testing is possible, and still useful, since I the fragment work I am doing is kinda hairy and needs to be air-tight.

There are two major branches of automated testing; unit or white box vs functional or black box testing.

Syndicate content