You are here

protected function AssertPageCacheContextsAndTagsTrait::enablePageCaching in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php \Drupal\system\Tests\Cache\AssertPageCacheContextsAndTagsTrait::enablePageCaching()

Enables page caching.

4 calls to AssertPageCacheContextsAndTagsTrait::enablePageCaching()
FrontPageTest::testCacheTagsWithCachePluginNone in core/modules/node/src/Tests/Views/FrontPageTest.php
Tests the cache tags when using the "none" cache plugin.
FrontPageTest::testCacheTagsWithCachePluginTag in core/modules/node/src/Tests/Views/FrontPageTest.php
Tests the cache tags when using the "tag" cache plugin.
FrontPageTest::testCacheTagsWithCachePluginTime in core/modules/node/src/Tests/Views/FrontPageTest.php
Tests the cache tags when using the "time" cache plugin.
PageCacheTagsIntegrationTest::setUp in core/modules/page_cache/src/Tests/PageCacheTagsIntegrationTest.php
Sets up a Drupal site for running functional and integration tests.

File

core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php, line 23
Contains \Drupal\system\Tests\Cache\AssertPageCacheContextsAndTagsTrait.

Class

AssertPageCacheContextsAndTagsTrait
Provides test assertions for testing page-level cache contexts & tags.

Namespace

Drupal\system\Tests\Cache

Code

protected function enablePageCaching() {
  $config = $this
    ->config('system.performance');
  $config
    ->set('cache.page.max_age', 300);
  $config
    ->save();
}