RSSAmplifier

Luca Corbo – · Apr 5, 2012

Drupal: Speed Up Simpletest Tests Usign Live Database

0
Sign in to vote or save

This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.

If you want to speed up Drupal Simpletest bootstrap a simple trick is to use the live database instead of the sandbox enviroment created by Simpletest. To do this simply override setUp and tearDown methods as reported below: <? php class SampleTest extends DrupalWebTestCase { function setUp () { $this -> setup = TRUE ; } function tearDown () { } //Your test here... Please note now you are using…

If you want to speed up Drupal Simpletest bootstrap a simple trick is to use the live database instead of the sandbox enviroment created by Simpletest.

To do this simply override setUp and tearDown methods as reported below:

<?php
class SampleTest extends DrupalWebTestCase {
 function setUp() {
 $this->setup = TRUE;
 }

 function tearDown() {
 }

 //Your test here...

Please note now you are using the live database… so eventual fake contents created by unit tests must be removed manually.

Read on /blog/drupal-speed-up-simpletest-tests-usign-live-database/

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.