protected function RenderedEntityTest::assertCacheabilityMetadata in Entity API 8.0
Ensures that the expected cacheability metadata is applied.
Parameters
array $build: The render array
2 calls to RenderedEntityTest::assertCacheabilityMetadata()
- RenderedEntityTest::testRenderedEntityWithField in src/
Tests/ Plugin/ views/ field/ RenderedEntityTest.php - Tests the rendered entity output with the body field configured to show.
- RenderedEntityTest::testRenderedEntityWithoutField in src/
Tests/ Plugin/ views/ field/ RenderedEntityTest.php - Tests the default rendered entity output.
File
- src/
Tests/ Plugin/ views/ field/ RenderedEntityTest.php, line 187 - Contains \Drupal\entity\Tests\Plugin\views\field\RenderedEntityTest.
Class
- RenderedEntityTest
- Tests the Drupal\entity\Plugin\views\field\RenderedEntity handler.
Namespace
Drupal\entity\Tests\Plugin\views\fieldCode
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']);
}