function RendererTestBase::setUpRequest

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

Sets up a request object on the request stack.

Parameters

string $method: The HTTP method to use for the request. Defaults to 'GET'.

19 calls to RendererTestBase::setUpRequest()
RendererBubblingTest::testBubblingWithoutPreRender in core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php
Tests bubbling of assets when NOT using #pre_render callbacks.
RendererBubblingTest::testBubblingWithPrerender in core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php
Tests bubbling of bubbleable metadata added by #pre_render callbacks.
RendererBubblingTest::testConditionalCacheContextBubblingSelfHealing in core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php
Tests the self-healing of the redirect with conditional cache contexts.
RendererBubblingTest::testContextBubblingCustomCacheBin in core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php
Tests cache context bubbling with a custom cache bin.
RendererBubblingTest::testContextBubblingEdgeCases in core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php
Tests cache context bubbling in edge cases, because it affects the CID.

... See full list

File

core/tests/Drupal/Tests/Core/Render/RendererTestBase.php, line 250

Class

RendererTestBase
Base class for the actual unit tests testing \Drupal\Core\Render\Renderer.

Namespace

Drupal\Tests\Core\Render

Code

protected function setUpRequest($method = 'GET') {
    $request = Request::create('/', $method);
    // Ensure that the request time is set as expected.
    $request->server
        ->set('REQUEST_TIME', (int) $_SERVER['REQUEST_TIME']);
    $this->requestStack
        ->push($request);
}

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