public function RenderCacheIntegrationTest::testFieldBasedViewCacheTagsWithCachePluginTime in Drupal 9
Same name and namespace in other branches
- 8 core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php \Drupal\Tests\views\Kernel\RenderCacheIntegrationTest::testFieldBasedViewCacheTagsWithCachePluginTime()
- 10 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 71
Class
- RenderCacheIntegrationTest
- Tests the general integration between views and the render cache.
Namespace
Drupal\Tests\views\KernelCode
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);
}