diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php index 5cb7792..c82a4b3 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php @@ -1088,7 +1088,7 @@ private function prepareEnvironment() { // Run all tests as a anonymous user by default, web tests will replace that // during the test set up. - $this->container->get('current_user')->setAccount(new AnonymousUserSession()); + $this->container->set('current_user', new AnonymousUserSession()); \Drupal::setContainer($this->container);