You are here

public function RendererTest::testRenderAccessCacheablityDependencyInheritance in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Render/RendererTest.php \Drupal\Tests\Core\Render\RendererTest::testRenderAccessCacheablityDependencyInheritance()

@covers ::render @covers ::doRender

File

core/tests/Drupal/Tests/Core/Render/RendererTest.php, line 488
Contains \Drupal\Tests\Core\Render\RendererTest.

Class

RendererTest
@coversDefaultClass \Drupal\Core\Render\Renderer @group Render

Namespace

Drupal\Tests\Core\Render

Code

public function testRenderAccessCacheablityDependencyInheritance() {
  $build = [
    '#access' => AccessResult::allowed()
      ->addCacheContexts([
      'user',
    ]),
  ];
  $this->renderer
    ->renderPlain($build);
  $this
    ->assertEquals([
    'languages:language_interface',
    'theme',
    'user',
  ], $build['#cache']['contexts']);
}