diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index 783bba0..00d6b61 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -1320,6 +1320,13 @@ class DrupalWebTestCase extends DrupalTestCase { $test_info['test_run_id'] = $this->databasePrefix; $test_info['in_child_site'] = FALSE; + // Preset the 'install_profile' system variable, so the first call into + // system_rebuild_module_data() (in drupal_install_system()) will register + // the test's profile as a module. Without this, the installation profile of + // the parent site (executing the test) is registered, and the test + // profile's hook_install() and other hook implementations are never invoked. + $conf['install_profile'] = $this->profile; + include_once DRUPAL_ROOT . '/includes/install.inc'; drupal_install_system();