Wednesday, November 24, 2010

SimpleTest and Testing modules

The SimpleTest module (Drupal 6.x) or Testing module (Drupal 7.x and beyond) provides a framework for running automated unit and functional tests in Drupal. It can be used to verify a working state of Drupal before and after any code changes, or as a means for developers to write and execute tests for their modules. The original module was based on the SimpleTest PHP library.

Visit Administer >> Site building >> SimpleTest (Drupal 6.x) or Administration >> Configuration >> Development >> Testing (Drupal 7.x) to display a list of available tests. For comprehensive testing, select all tests, or individually select tests for more targeted testing. (Note: Selecting all tests may take several minutes to complete, and if you select too many, they may fail to complete.)

After the tests have run, a message will be displayed next to each test group indicating whether tests within it passed, failed, or had exceptions. A pass means that a test returned the expected results, while fail means that it did not. An exception normally indicates an error outside of the test, such as a PHP warning or notice. If there were fails or exceptions, the results are expanded, and the tests that had issues will be indicated in red or pink rows. Use these results to refine your code and tests until all tests return a pass.

For more information on creating and modifying your own tests, read the rest of the SimpleTest Documentation in the Drupal handbook.

For more information about Drupal Development, Drupal Expert, Drupal Developer and Drupal Programmer visit at


No comments:

Post a Comment