You are here

public function FrontPageTest::testCacheTagsWithCachePluginTime in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/node/src/Tests/Views/FrontPageTest.php \Drupal\node\Tests\Views\FrontPageTest::testCacheTagsWithCachePluginTime()

Tests the cache tags when using the "time" cache plugin.

File

core/modules/node/src/Tests/Views/FrontPageTest.php, line 216
Contains \Drupal\node\Tests\Views\FrontPageTest.

Class

FrontPageTest
Tests the default frontpage provided by views.

Namespace

Drupal\node\Tests\Views

Code

public function testCacheTagsWithCachePluginTime() {
  $this
    ->enablePageCaching();
  $view = Views::getView('frontpage');
  $view
    ->setDisplay('page_1');
  $view->display_handler
    ->overrideOption('cache', [
    'type' => 'time',
    'options' => [
      'results_lifespan' => 3600,
      'output_lifespan' => 3600,
    ],
  ]);
  $view
    ->save();
  $this
    ->doTestFrontPageViewCacheTags(TRUE);
}