From 0a4d2b559e9d4fd33384afca42735877c29d027c Mon Sep 17 00:00:00 2001 From: webchick Date: Mon, 29 Dec 2014 12:59:39 -0800 Subject: [PATCH] Revert "Issue #2263339 by damiankloip, blueminds, mgifford, xjm, almaudoh, mitrpaka, znerol, dawehner: Fix all current_user set calls" Does not use new API yet. This reverts commit b422ee7f22f21189abdada69bcc0a57d2c2e0bba. --- core/modules/system/src/Tests/Form/FormCacheTest.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/modules/system/src/Tests/Form/FormCacheTest.php b/core/modules/system/src/Tests/Form/FormCacheTest.php index 4f75e4ca6cd..906a1292e7b 100644 --- a/core/modules/system/src/Tests/Form/FormCacheTest.php +++ b/core/modules/system/src/Tests/Form/FormCacheTest.php @@ -8,7 +8,6 @@ namespace Drupal\system\Tests\Form; use Drupal\Core\Form\FormState; -use Drupal\Core\Session\AnonymousUserSession; use Drupal\Core\Session\UserSession; use Drupal\simpletest\KernelTestBase; @@ -89,8 +88,7 @@ class FormCacheTest extends KernelTestBase { * Tests the form cache without a logged-in user. */ function testNoCacheToken() { - $current_user = $this->container->get('current_user'); - $current_user->setAccount(new AnonymousUserSession()); + $this->container->set('current_user', new UserSession(array('uid' => 0))); $this->form_state->set('example', $this->randomMachineName()); \Drupal::formBuilder()->setCache($this->form_build_id, $this->form, $this->form_state);