You are here

protected function ViewsDisplayCachingTest::assertViewsCacheability in Search API 8

Checks the cacheability metadata of the given view.

Parameters

\Drupal\views\ViewExecutable $view: The view to test.

string[] $expected_cache_tags: The expected cache tags.

string[] $expected_cache_contexts: The expected cache contexts.

int $expected_max_age: The expected cache max age.

1 call to ViewsDisplayCachingTest::assertViewsCacheability()
ViewsDisplayCachingTest::testDisplayCacheability in tests/src/Kernel/Views/ViewsDisplayCachingTest.php
Tests whether the search display plugin for a new view is available.

File

tests/src/Kernel/Views/ViewsDisplayCachingTest.php, line 198

Class

ViewsDisplayCachingTest
Tests the Search API caching plugins for Views.

Namespace

Drupal\Tests\search_api\Kernel\Views

Code

protected function assertViewsCacheability(ViewExecutable $view, array $expected_cache_tags, array $expected_cache_contexts, $expected_max_age) {
  $build = $this
    ->assertViewsCacheTags($view, NULL, FALSE, $expected_cache_tags);
  $this
    ->assertCacheContexts($expected_cache_contexts, $build);
  $this
    ->assertCacheMaxAge($expected_max_age, $build);
}