You are here

protected function FieldRenderedEntityTest::assertCacheabilityMetadata in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/Kernel/Handler/FieldRenderedEntityTest.php \Drupal\Tests\views\Kernel\Handler\FieldRenderedEntityTest::assertCacheabilityMetadata()

Ensures that the expected cacheability metadata is applied.

Parameters

array $build: The render array

2 calls to FieldRenderedEntityTest::assertCacheabilityMetadata()
FieldRenderedEntityTest::testRenderedEntityWithField in core/modules/views/tests/src/Kernel/Handler/FieldRenderedEntityTest.php
Tests the rendered entity output with the test field configured to show.
FieldRenderedEntityTest::testRenderedEntityWithoutField in core/modules/views/tests/src/Kernel/Handler/FieldRenderedEntityTest.php
Tests the default rendered entity output.

File

core/modules/views/tests/src/Kernel/Handler/FieldRenderedEntityTest.php, line 133

Class

FieldRenderedEntityTest
Tests the core Drupal\views\Plugin\views\field\RenderedEntity handler.

Namespace

Drupal\Tests\views\Kernel\Handler

Code

protected function assertCacheabilityMetadata($build) {
  $this
    ->assertEqual([
    'config:core.entity_view_display.entity_test.entity_test.foobar',
    'config:views.view.test_field_entity_test_rendered',
    'entity_test:1',
    'entity_test:2',
    'entity_test:3',
    'entity_test_list',
    'entity_test_view',
  ], $build['#cache']['tags']);
  $this
    ->assertEqual([
    'entity_test_view_grants',
    'languages:language_interface',
    'theme',
    'url.query_args',
    'user.permissions',
  ], $build['#cache']['contexts']);
}