diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/simpletest/drupal_web_test_case.php | 5 | ||||
-rw-r--r-- | modules/simpletest/tests/module.test | 4 | ||||
-rw-r--r-- | modules/system/system.install | 17 | ||||
-rw-r--r-- | modules/system/system.module | 12 |
4 files changed, 36 insertions, 2 deletions
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index 51b983a34..893c7e8c6 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -1037,6 +1037,7 @@ class DrupalWebTestCase extends DrupalTestCase { $this->originalLanguageDefault = variable_get('language_default'); $this->originalPrefix = $db_prefix; $this->originalFileDirectory = file_directory_path(); + $this->originalProfile = drupal_get_profile(); $clean_url_original = variable_get('clean_url', 0); // Generate temporary prefixed database to ensure that tests have a clean starting point. @@ -1062,7 +1063,7 @@ class DrupalWebTestCase extends DrupalTestCase { $this->preloadRegistry(); // Include the default profile - require_once('./profiles/default/default.profile'); + variable_set('install_profile', 'default'); $profile_details = install_profile_info('default', 'en'); // Add the specified modules to the list of modules in the default profile. @@ -1086,7 +1087,7 @@ class DrupalWebTestCase extends DrupalTestCase { // Run default profile tasks. $install_state = array(); - default_profile_site_setup($install_state); + drupal_install_modules(array('default'), TRUE); // Rebuild caches. node_types_rebuild(); diff --git a/modules/simpletest/tests/module.test b/modules/simpletest/tests/module.test index ee95044e0..5c703c287 100644 --- a/modules/simpletest/tests/module.test +++ b/modules/simpletest/tests/module.test @@ -25,6 +25,10 @@ class ModuleUnitTest extends DrupalWebTestCase { // Build a list of modules, sorted alphabetically. $profile_info = install_profile_info('default', 'en'); $module_list = $profile_info['dependencies']; + + // Install profile is a module that is expected to be loaded. + $module_list[] = 'default'; + sort($module_list); // Compare this list to the one returned by module_list(). We expect them // to match, since all default profile modules have a weight equal to 0 diff --git a/modules/system/system.install b/modules/system/system.install index 594f311bd..e555e5795 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -28,6 +28,23 @@ function system_requirements($phase) { 'severity' => REQUIREMENT_INFO, 'weight' => -10, ); + + // Display the currently active install profile, if the site + // is not running the default install profile. + $profile = drupal_get_profile(); + if ($profile != 'default') { + $info = install_profile_info($profile); + $requirements['install_profile'] = array( + 'title' => $t('Install profile'), + 'value' => $t('%profile_name (%profile-%version)', array( + '%profile_name' => $info['name'], + '%profile' => $profile, + '%version' => $info['version'] + )), + 'severity' => REQUIREMENT_INFO, + 'weight' => -9 + ); + } } // Web server information. diff --git a/modules/system/system.module b/modules/system/system.module index 2eb1fafb4..a98438365 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -1753,6 +1753,15 @@ function _system_get_module_data() { // Find modules $modules = drupal_system_listing('/\.module$/', 'modules', 'name', 0); + // Include the install profile in modules that are loaded. + $profile = drupal_get_profile(); + $modules[$profile]->name = $profile; + $modules[$profile]->uri = 'profiles/' . $profile . '/' . $profile . '.profile'; + $modules[$profile]->filename = $profile . '.profile'; + + // Install profile hooks are always executed last. + $modules[$profile]->weight = 1000; + // Set defaults for module info. $defaults = array( 'dependencies' => array(), @@ -1783,6 +1792,9 @@ function _system_get_module_data() { drupal_alter('system_info', $modules[$key]->info, $modules[$key]); } + // The install profile is required. + $modules[$profile]->info['required'] = TRUE; + return $modules; } |