Issue #1950684 by Berdir: Fixed Mock and protect ['user'] in DUTB tests.

8.0.x
Alex Pott 2013-04-08 00:17:26 +01:00
parent 42bfe9293d
commit 8a0160034a
2 changed files with 3 additions and 4 deletions

View File

@ -867,6 +867,9 @@ abstract class TestBase {
// Ensure that the current session is not changed by the new environment.
drupal_save_session(FALSE);
// Run all tests as a anonymous user by default, web tests will replace that
// during the test set up.
$user = drupal_anonymous_user();
// Save and clean the shutdown callbacks array because it is static cached
// and will be changed by the test run. Otherwise it will contain callbacks

View File

@ -775,10 +775,6 @@ abstract class WebTestBase extends TestBase {
),
);
// Replace the global $user session with an anonymous user to resemble a
// regular installation.
$user = drupal_anonymous_user();
// Reset the static batch to remove Simpletest's batch operations.
$batch = &batch_get();
$batch = array();