function AjaxBasePageNegotiatorTest::setUp

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Theme/AjaxBasePageNegotiatorTest.php \Drupal\Tests\Core\Theme\AjaxBasePageNegotiatorTest::setUp()
  2. 8.9.x core/tests/Drupal/Tests/Core/Theme/AjaxBasePageNegotiatorTest.php \Drupal\Tests\Core\Theme\AjaxBasePageNegotiatorTest::setUp()
  3. 11.x core/tests/Drupal/Tests/Core/Theme/AjaxBasePageNegotiatorTest.php \Drupal\Tests\Core\Theme\AjaxBasePageNegotiatorTest::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Theme/AjaxBasePageNegotiatorTest.php, line 46

Class

AjaxBasePageNegotiatorTest
@coversDefaultClass \Drupal\Core\Theme\AjaxBasePageNegotiator @group Theme

Namespace

Drupal\Tests\Core\Theme

Code

protected function setUp() : void {
    parent::setUp();
    $this->tokenGenerator = $this->prophesize(CsrfTokenGenerator::class);
    $config_factory = $this->getConfigFactoryStub([
        'system.theme' => [
            'default' => 'stark',
        ],
    ]);
    $this->requestStack = new RequestStack();
    $this->negotiator = new AjaxBasePageNegotiator($this->tokenGenerator
        ->reveal(), $config_factory, $this->requestStack);
}

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