Skip to content
Snippets Groups Projects
Commit 8a016003 authored by Alex Pott's avatar Alex Pott
Browse files

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

parent 42bfe929
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -867,6 +867,9 @@ protected function prepareEnvironment() {
// 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
......
......@@ -775,10 +775,6 @@ protected function setUp() {
),
);
// 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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment