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 b422ee7f22
.
8.0.x
parent
b422ee7f22
commit
0a4d2b559e
|
@ -8,7 +8,6 @@
|
||||||
namespace Drupal\system\Tests\Form;
|
namespace Drupal\system\Tests\Form;
|
||||||
|
|
||||||
use Drupal\Core\Form\FormState;
|
use Drupal\Core\Form\FormState;
|
||||||
use Drupal\Core\Session\AnonymousUserSession;
|
|
||||||
use Drupal\Core\Session\UserSession;
|
use Drupal\Core\Session\UserSession;
|
||||||
use Drupal\simpletest\KernelTestBase;
|
use Drupal\simpletest\KernelTestBase;
|
||||||
|
|
||||||
|
@ -89,8 +88,7 @@ class FormCacheTest extends KernelTestBase {
|
||||||
* Tests the form cache without a logged-in user.
|
* Tests the form cache without a logged-in user.
|
||||||
*/
|
*/
|
||||||
function testNoCacheToken() {
|
function testNoCacheToken() {
|
||||||
$current_user = $this->container->get('current_user');
|
$this->container->set('current_user', new UserSession(array('uid' => 0)));
|
||||||
$current_user->setAccount(new AnonymousUserSession());
|
|
||||||
|
|
||||||
$this->form_state->set('example', $this->randomMachineName());
|
$this->form_state->set('example', $this->randomMachineName());
|
||||||
\Drupal::formBuilder()->setCache($this->form_build_id, $this->form, $this->form_state);
|
\Drupal::formBuilder()->setCache($this->form_build_id, $this->form, $this->form_state);
|
||||||
|
|
Loading…
Reference in New Issue