This project is not covered by Drupal’s security advisory policy.

This module extends the SimpleTest module to allow module developers to run a faster and fully compatible version of it's DrupalWebTestCase test, with a information loss kept near the minimum. It has been created to make test driven development less painful, without having to switch to a different testing framework than the standard one.

To achieve a major speed improvement Quick SimpleTest caches parts of the setUp() method of the test run, which gets called before every test method.
This takes a very long time to finish up, because it will install a hole Drupal environment and then enable a list of requested or required modules. This module will make save marks after these two operations and on the next call to setUp it will start from them.

Features

  • Fast test runs
  • Fully compatible to DrupalWebTestCase
  • Two chamber caching system ( drupal installation, module installation )
  • Automatic cache recreation, when module list and/or installation profile get changed
  • Ui for clearing certain/all cache

Benchmarks

The table below shows the times measured, on my notebook using Xhprof, for the book functionality test, which contains 4 test methods.
I closed all application before running the test.

  SimpleTest Quick SimpleTest ( with unknown profile and test class ) Quick SimpleTest ( with known profile, but unknown test class ) Quick SimpleTest ( with known profile and test class )
total 14 min 1 sec 6 min 3 sec 3 min 14 sec 2 min 51 sec
( test framework )
::setUp()
8 min 26 sec 3 min 23 sec 36 sec 2 sec

Requirements

  • php-curl libary
  • pdo-sqlite libary

Installation

Unfortunately, it will need you to patch your bootstrap.inc in includes with the quick_simpletest_bootstrap.patch coming with this module. For information on how to do so read the INSTALL.txt and/or go here.

Usage

Instead of

 YourTestCase extends DrupalWebTestCase {
  ...your tests
}

write

 YourTestCase extends QuickSimpleTestTestCase {
  ...your tests
}

in your test file, that's all. You can change back and forth as often you want to.

Limits

The tests will not detect any errors special to your db system, because it uses SQLite databases in all situations. Also if you enable module caching ( default ) it will not test the enabling of modules.

Known problems

  • If an exception/error occurs doing setUp() cache might be/became demaged. Please clear it out on the testing settings site.

Similar projects

Project information

Releases