$this->
assertEqualsCanonicalizing($expected_render_array_cache_tags,
$build['#cache'
]['tags'
]);
if ($views_caching_is_enabled) { // Check Views render cache item cache tags.
/** @var \Drupal\views\Plugin\views\cache\CachePluginBase $cache_plugin */
$cache_plugin =
$view->display_handler->
getPlugin('cache'
);
// Results cache.
// Ensure that the views query is built.
$view->
build();
$results_cache_item = \Drupal::
cache('data'
)->
get($cache_plugin->
generateResultsKey());
if (is_array($expected_results_cache)) { $this->
assertNotEmpty($results_cache_item, 'Results cache item found.'
);
if ($results_cache_item) { $this->
assertEqualsCanonicalizing($expected_results_cache,
$results_cache_item->tags
);
} } else { $this->
assertNull($results_cache_item, 'Results cache item not found.'
);
} // Check Views render cache item cache tags.