diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index 73aec6f2ead32330214725300d44a51e764a9133..e5d043792f279d8f37da75edc5442439e790e8c1 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -778,6 +778,8 @@ protected function setUp() { include_once DRUPAL_ROOT . '/includes/install.inc'; drupal_install_system(); + $this->preloadRegistry(); + // Add the specified modules to the list of modules in the default profile. $args = func_get_args(); $modules = array_unique(array_merge(drupal_get_profile_modules('default', 'en'), $args)); @@ -794,7 +796,6 @@ protected function setUp() { default_profile_tasks($task, ''); // Rebuild caches. - menu_rebuild(); actions_synchronize(); _drupal_flush_css_js(); $this->refreshVariables(); @@ -812,6 +813,16 @@ protected function setUp() { file_check_directory($directory, FILE_CREATE_DIRECTORY); // Create the files directory. } + /** + * This method is called by DrupalWebTestCase::setUp, and preloads the + * registry from the testing site to cut down on the time it takes to + * setup the a clean environment for the current test run. + */ + protected function preloadRegistry() { + db_query('INSERT INTO {registry} SELECT * FROM ' . $this->originalPrefix . 'registry'); + db_query('INSERT INTO {registry_file} SELECT * FROM ' . $this->originalPrefix . 'registry_file'); + } + /** * Refresh the in-memory set of variables. Useful after a page request is made * that changes a variable in a different thread.