diff --git a/core/modules/comment/src/Tests/Views/CommentFieldNameTest.php b/core/modules/comment/src/Tests/Views/CommentFieldNameTest.php index 237abb0..ab40e6f 100644 --- a/core/modules/comment/src/Tests/Views/CommentFieldNameTest.php +++ b/core/modules/comment/src/Tests/Views/CommentFieldNameTest.php @@ -81,7 +81,7 @@ public function testCommentFieldName() { // Grant permission to properly check view access on render. user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, ['access comments']); - $this->container->get('current_user')->setAccount(new AnonymousUserSession()); + $this->container->get('account_switcher')->switchTo(new AnonymousUserSession()); $view = Views::getView('test_comment_field_name'); $this->executeView($view); // Test that data rendered.