diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 0b861c4..e257aa4 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -2147,12 +2147,10 @@ function drupal_bootstrap($phase = NULL, $new_phase = TRUE) { DRUPAL_BOOTSTRAP_LANGUAGE, DRUPAL_BOOTSTRAP_FULL, ); - // Not drupal_static(), because the only legitimate API to control this is to - // call drupal_bootstrap() with a new phase parameter. - static $final_phase; - // Not drupal_static(), because it's impossible to roll back to an earlier - // bootstrap state. - static $stored_phase = -1; + // drupal_static(), since tests need to be able to re-bootstrap Drupal from an + // almost clean slate. + $final_phase = &drupal_static('bootstrap:final'); + $stored_phase = &drupal_static('bootstrap:last', -1); // When not recursing, store the phase name so it's not forgotten while // recursing. diff --git a/core/modules/simpletest/drupal_web_test_case.php b/core/modules/simpletest/drupal_web_test_case.php index a5fb606..b7a914b 100644 --- a/core/modules/simpletest/drupal_web_test_case.php +++ b/core/modules/simpletest/drupal_web_test_case.php @@ -1400,9 +1400,15 @@ class DrupalWebTestCase extends DrupalTestCase { module_enable(array($this->profile), FALSE); } + debug(drupal_static('file_get_stream_wrappers')); // Reset/rebuild all data structures after enabling the modules. +// system_rebuild_module_data(); $this->resetAll(); + // Bootstrap into test environment. + drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); + debug(drupal_static('file_get_stream_wrappers')); + // Run cron once in that environment, as install.php does at the end of // the installation process. drupal_cron_run(); diff --git a/core/modules/simpletest/tests/file.test b/core/modules/simpletest/tests/file.test index 7496902..3a73c08 100644 --- a/core/modules/simpletest/tests/file.test +++ b/core/modules/simpletest/tests/file.test @@ -47,6 +47,8 @@ function file_test_file_scan_callback_reset() { * assertions and helper functions. */ class FileTestCase extends DrupalWebTestCase { + protected $profile = 'testing'; + /** * Check that two files have the same values for all fields other than the * timestamp.