function SynchronizeCsrfTokenSeedTrait::rebuildContainer

Same name in other branches
  1. 9 core/modules/ckeditor5/tests/src/Traits/SynchronizeCsrfTokenSeedTrait.php \Drupal\Tests\ckeditor5\Traits\SynchronizeCsrfTokenSeedTrait::rebuildContainer()
  2. 11.x core/modules/ckeditor5/tests/src/Traits/SynchronizeCsrfTokenSeedTrait.php \Drupal\Tests\ckeditor5\Traits\SynchronizeCsrfTokenSeedTrait::rebuildContainer()
1 call to SynchronizeCsrfTokenSeedTrait::rebuildContainer()
MediaEntityMetadataApiTest::testApiTranslation in core/modules/ckeditor5/tests/src/Functional/MediaEntityMetadataApiTest.php
Tests the media entity metadata API with translations.

File

core/modules/ckeditor5/tests/src/Traits/SynchronizeCsrfTokenSeedTrait.php, line 39

Class

SynchronizeCsrfTokenSeedTrait
Synchronizes the child site's CSRF token seed back to the test runner.

Namespace

Drupal\Tests\ckeditor5\Traits

Code

protected function rebuildContainer() {
    parent::rebuildContainer();
    // Ensure that the CSRF token seed is reset on container rebuild.
    if ($this->loggedInUser) {
        $current_user = $this->loggedInUser;
        $this->drupalLogout();
        $this->drupalLogin($current_user);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.