function RenderCacheIntegrationTest::testFieldBasedViewCacheTagsWithCachePluginTime

Same name in other branches
  1. 9 core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php \Drupal\Tests\views\Kernel\RenderCacheIntegrationTest::testFieldBasedViewCacheTagsWithCachePluginTime()
  2. 8.9.x core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php \Drupal\Tests\views\Kernel\RenderCacheIntegrationTest::testFieldBasedViewCacheTagsWithCachePluginTime()
  3. 11.x core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php \Drupal\Tests\views\Kernel\RenderCacheIntegrationTest::testFieldBasedViewCacheTagsWithCachePluginTime()

Tests a field-based view's cache tags when using the "time" cache plugin.

File

core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php, line 74

Class

RenderCacheIntegrationTest
Tests the general integration between views and the render cache.

Namespace

Drupal\Tests\views\Kernel

Code

public function testFieldBasedViewCacheTagsWithCachePluginTime() : void {
    $view = Views::getView('entity_test_fields');
    $view->getDisplay()
        ->overrideOption('cache', [
        'type' => 'time',
        'options' => [
            'results_lifespan' => 3600,
            'output_lifespan' => 3600,
        ],
    ]);
    $view->save();
    $this->assertCacheTagsForFieldBasedView(TRUE);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.