summaryrefslogtreecommitdiff
path: root/modules/simpletest/drupal_web_test_case.php
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-03-02 09:07:09 +0000
committerDries Buytaert <dries@buytaert.net>2010-03-02 09:07:09 +0000
commita5d180b9c0c49aa2eb277d0c0eab764fcf38ef73 (patch)
tree61bd91ba8846b011507e61733d93680660e3f788 /modules/simpletest/drupal_web_test_case.php
parent0d9eedc8fb26b550c766b432e3e237c563272ace (diff)
downloadbrdo-a5d180b9c0c49aa2eb277d0c0eab764fcf38ef73.tar.gz
brdo-a5d180b9c0c49aa2eb277d0c0eab764fcf38ef73.tar.bz2
- Patch #347959 by sun, Damien Tournoud, justinrandell, scor, chx: modules_installed() was broken during testing.
Diffstat (limited to 'modules/simpletest/drupal_web_test_case.php')
-rw-r--r--modules/simpletest/drupal_web_test_case.php34
1 files changed, 15 insertions, 19 deletions
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php
index 5a364f9b9..d07e0b2f1 100644
--- a/modules/simpletest/drupal_web_test_case.php
+++ b/modules/simpletest/drupal_web_test_case.php
@@ -547,8 +547,7 @@ abstract class DrupalTestCase {
*
* These tests can not access the database nor files. Calling any Drupal
* function that needs the database will throw exceptions. These include
- * watchdog(), function_exists(), module_implements(),
- * module_invoke_all() etc.
+ * watchdog(), module_implements(), module_invoke_all() etc.
*/
class DrupalUnitTestCase extends DrupalTestCase {
@@ -1124,8 +1123,7 @@ class DrupalWebTestCase extends DrupalTestCase {
ini_set('log_errors', 1);
ini_set('error_log', $public_files_directory . '/error.log');
- // Reset all statics and variables so that test is performed with a clean
- // environment.
+ // Reset all statics and variables to perform tests in a clean environment.
$conf = array();
drupal_static_reset();
@@ -1139,32 +1137,30 @@ class DrupalWebTestCase extends DrupalTestCase {
$profile_details = install_profile_info('standard', 'en');
// Install the modules specified by the default profile.
- module_enable($profile_details['dependencies'], FALSE, TRUE);
-
- drupal_static_reset('_node_types_build');
+ module_enable($profile_details['dependencies'], FALSE);
+ // Install modules needed for this test.
if ($modules = func_get_args()) {
- // Install modules needed for this test.
- module_enable($modules, TRUE, TRUE);
+ module_enable($modules, TRUE);
}
- // Because the schema is static cached, we need to flush
- // it between each run. If we don't, then it will contain
- // stale data for the previous run's database prefix and all
- // calls to it will fail.
- drupal_get_schema(NULL, TRUE);
-
// Run default profile tasks.
- $install_state = array();
- module_enable(array('standard'), FALSE, TRUE);
+ module_enable(array('standard'), FALSE);
// Rebuild caches.
- node_types_rebuild();
+ drupal_static_reset();
+ drupal_flush_all_caches();
+
+ // Register actions declared by any modules.
actions_synchronize();
- _drupal_flush_css_js();
+
+ // Reload global $conf array and permissions.
$this->refreshVariables();
$this->checkPermissions(array(), TRUE);
+ // Reset statically cached schema for new database prefix.
+ drupal_get_schema(NULL, TRUE);
+
// Run cron once in that environment, as install.php does at the end of
// the installation process.
drupal_cron_run();