--- drupal_web_test_case.php.orig 2009-04-17 12:23:26.000000000 +1200 +++ drupal_web_test_case.php 2009-04-17 12:21:45.000000000 +1200 @@ -289,11 +289,20 @@ // $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)); - $modules = array_unique(array_merge(drupal_verify_profile('default', 'en'), $args)); + // Use default profile if possible, otherwise use whatever profile the site was installed with + if (file_exists('./profiles/default/default.profile')) { + $profile_in_use = 'default'; + $modules = array_unique(array_merge(drupal_verify_profile('default', 'en'), $args)); + } + else { + drupal_set_message(t('This installation does not have a copy of the default install profile available. SimpleTest will attempt to use your running install profile, but functionality and performance may be degraded.'), 'warning'); + $profile_in_use = variable_get('install_profile', 'default'); + $modules = array_unique(array_merge(drupal_verify_profile($profile_in_use, 'en'), $args)); + } // drupal_install_modules($modules, TRUE); drupal_install_modules($modules); // Because the schema is static cached, we need to flush // it between each run. If we don't, then it will contain @@ -301,11 +310,11 @@ // calls to it will fail. drupal_get_schema(NULL, TRUE); // Run default profile tasks. $task = 'profile'; - default_profile_tasks($task, ''); + module_invoke($profile_in_use, 'profile_tasks', $task, ''); // Rebuild caches. actions_synchronize(); _drupal_flush_css_js(); $this->refreshVariables();