protected function ViewsCacheInvalidationTest::getRenderableView in Search API 8
Returns the test view as a render array.
Return value
array|null The render array, or NULL if the view cannot be rendered.
1 call to ViewsCacheInvalidationTest::getRenderableView()
- ViewsCacheInvalidationTest::assertViewsResult in tests/
src/ Kernel/ Views/ ViewsCacheInvalidationTest.php - Checks that the view for the given user contains the expected results.
File
- tests/
src/ Kernel/ Views/ ViewsCacheInvalidationTest.php, line 428
Class
- ViewsCacheInvalidationTest
- Tests that cached Search API views get invalidated at the right occasions.
Namespace
Drupal\Tests\search_api\Kernel\ViewsCode
protected function getRenderableView() {
$render_array = $this
->getView()
->buildRenderable();
$renderer_config = $this->container
->getParameter('renderer.config');
$render_array['#cache']['contexts'] = Cache::mergeContexts($render_array['#cache']['contexts'], $renderer_config['required_cache_contexts']);
return $render_array;
}