diff --git a/includes/install.core.inc b/includes/install.core.inc index 443ec8aa4ffafaba4e4b0c5deb6c4d86ef1b1d91..5e16023b27c5cdf3c1465c0cde46e1f6a3bcebd2 100644 --- a/includes/install.core.inc +++ b/includes/install.core.inc @@ -1111,6 +1111,11 @@ function install_select_profile_form($form, &$form_state, $profile_files) { include_once DRUPAL_ROOT . '/' . $profile->uri; $details = install_profile_info($profile->name); + // Don't show hidden profiles. This is used by to hide the testing profile, + // which only exists to speed up test runs. + if ($details['hidden'] === TRUE) { + continue; + } $profiles[$profile->name] = $details; // Determine the name of the profile; default to file name if defined name diff --git a/includes/install.inc b/includes/install.inc index 92528d880de059a55239c27c9936e5a4320978a3..e68e272d3333e5ab1fa6719412474092a264cc39 100644 --- a/includes/install.inc +++ b/includes/install.inc @@ -1022,6 +1022,7 @@ function install_profile_info($profile, $locale = 'en') { 'description' => '', 'distribution_name' => 'Drupal', 'version' => NULL, + 'hidden' => FALSE, 'php' => DRUPAL_MINIMUM_PHP, ); $info = drupal_parse_info_file("profiles/$profile/$profile.info") + $defaults; diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index b5babec212b2c1801b23e6de5485bf40118c9fa5..739aaa74fb1fa55de514b8d20463b0c6b0eee8e9 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -621,6 +621,13 @@ protected function tearDown() { * Test case for typical Drupal tests. */ 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. * @@ -1193,11 +1200,11 @@ protected function setUp() { 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 @@ protected function setUp() { 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 @@ protected function verbose($message) { $this->error(l(t('Verbose message'), $url, array('attributes' => array('target' => '_blank'))), 'User notice'); } } - } /** diff --git a/modules/simpletest/tests/database_test.test b/modules/simpletest/tests/database_test.test index e7f81289363934b8f29f8ada99941f0f3a97399d..89b28537a594fac6ed473d6e74ec5a92712eb695 100644 --- a/modules/simpletest/tests/database_test.test +++ b/modules/simpletest/tests/database_test.test @@ -17,6 +17,7 @@ class FakeRecord { } * here. */ class DatabaseTestCase extends DrupalWebTestCase { + protected $profile = 'testing'; function setUp() { parent::setUp('database_test'); diff --git a/profiles/testing/testing.info b/profiles/testing/testing.info new file mode 100644 index 0000000000000000000000000000000000000000..a82b1158ab76f42860a35f1587a63cd23790956d --- /dev/null +++ b/profiles/testing/testing.info @@ -0,0 +1,6 @@ +; $Id$ +name = Testing +description = Totally stripped back testing profile. +version = VERSION +core = 7.x +hidden = TRUE diff --git a/profiles/testing/testing.install b/profiles/testing/testing.install new file mode 100644 index 0000000000000000000000000000000000000000..74a1fff0085bb9b7f2ef5b2cfee1bd24c68ccf41 --- /dev/null +++ b/profiles/testing/testing.install @@ -0,0 +1,17 @@ +