You are here

protected function RendererTestBase::setUpRequest in Drupal 8

Same name and namespace in other branches
  1. 9 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'.

17 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 231
Contains \Drupal\Tests\Core\Render\RendererTestBase.

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);
}