[drupal-devel] Unit tests in Drupal.

Gerhard Killesreiter killesreiter at physik.uni-freiburg.de
Sat May 21 16:30:09 UTC 2005



On Sat, 21 May 2005, Kieran Lal wrote:

> On May 21, 2005, at 4:05 AM, Adrian Rossouw wrote:
>
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > I know there has been some discussion regarding this in the past,
> > but I was wondering what it would actually
> > take to get Drupal into a state where we take advantage of unit
> > testing.

I thing we need to distinguish between unit testing (as proposed by
Moshe) and checking the generated html as proposed by me using wget (or
similar tools).

Moshe's simpletest module will actually call our PHP functions and
execute them, checking the results.

The other method will test the whole site and provided functionality
from the outside.

It is obvious that Drupal can benefit from both methods.

> The main resource for finding OSS testing tools is: http://
> opensourcetesting.com
>
> Here are link checkers: http://www.opensourcetesting.org/
> link_checkers.php
> http://linkchecker.sourceforge.net/
> http://j-spider.sourceforge.net/
> http://htcheck.sourceforge.net/

Those probably implement the sort of crawler that I made from wget.

> Functional testing:
> jWebUnit http://jwebunit.sourceforge.net/
> WebInject http://www.webinject.org/

Those are more interesting. I've had a look at their manual and despite
the fact that I don't like XML I think we could for example created the
following test:

1) user logs in
2) user goes to node/add/foo
3) user posts new node.

We could create typical user paths by looking at the data that
drupal.org collects and create test cases for them.

> You should know I am currently running a testing program for the
> contribution modules we add to CivicSpace.  My testing plan is here:
> http://civicspacelabs.org/home/node/12441.

Will look at it later.

Cheers,
	Gerhard




More information about the drupal-devel mailing list