diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-08-22 15:31:18 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-08-22 15:31:18 +0000 |
commit | 153ef8bd7b79fa4063a3994cd653721249e9c465 (patch) | |
tree | c5eba601e3aab1b62086a7904ed070e26683d5c5 /modules/simpletest/drupal_web_test_case.php | |
parent | 260dbda9708a68e83b7ab84e1d947abae123a9d1 (diff) | |
download | brdo-153ef8bd7b79fa4063a3994cd653721249e9c465.tar.gz brdo-153ef8bd7b79fa4063a3994cd653721249e9c465.tar.bz2 |
- Patch #323477 by justinrandell, boombatower, tstoeckler, Damien Tournoud: increase simpletest speed by running on a simplified profile.
Diffstat (limited to 'modules/simpletest/drupal_web_test_case.php')
-rw-r--r-- | modules/simpletest/drupal_web_test_case.php | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index b5babec21..739aaa74f 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -622,6 +622,13 @@ class DrupalUnitTestCase extends DrupalTestCase { */ class DrupalWebTestCase extends DrupalTestCase { /** + * The profile to install as a basis for testing. + * + * @var string + */ + protected $profile = 'standard'; + + /** * The URL currently loaded in the internal browser. * * @var string @@ -1193,11 +1200,11 @@ class DrupalWebTestCase extends DrupalTestCase { variable_set('file_private_path', $private_files_directory); variable_set('file_temporary_path', $temp_files_directory); - // Include the default profile. - variable_set('install_profile', 'standard'); - $profile_details = install_profile_info('standard', 'en'); + // Include the testing profile. + variable_set('install_profile', $this->profile); + $profile_details = install_profile_info($this->profile, 'en'); - // Install the modules specified by the default profile. + // Install the modules specified by the testing profile. module_enable($profile_details['dependencies'], FALSE); // Install modules needed for this test. This could have been passed in as @@ -1212,8 +1219,13 @@ class DrupalWebTestCase extends DrupalTestCase { module_enable($modules, TRUE); } - // Run default profile tasks. - module_enable(array('standard'), FALSE); + // Run the profile tasks. + $install_profile_module_exists = db_query("SELECT 1 FROM {system} WHERE type = 'module' AND name = :name", array( + ':name' => $this->profile)) + ->fetchField(); + if ($install_profile_module_exists) { + module_enable(array($this->profile), FALSE); + } // Rebuild caches. drupal_static_reset(); @@ -3064,7 +3076,6 @@ class DrupalWebTestCase extends DrupalTestCase { $this->error(l(t('Verbose message'), $url, array('attributes' => array('target' => '_blank'))), 'User notice'); } } - } /** |