You are here

public function RenderCacheIntegrationTest::testFieldBasedViewCacheTagsWithCachePluginTime in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/views/src/Tests/RenderCacheIntegrationTest.php \Drupal\views\Tests\RenderCacheIntegrationTest::testFieldBasedViewCacheTagsWithCachePluginTime()

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

File

core/modules/views/src/Tests/RenderCacheIntegrationTest.php, line 75
Contains \Drupal\views\Tests\RenderCacheIntegrationTest.

Class

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

Namespace

Drupal\views\Tests

Code

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