function AssertPageCacheContextsAndTagsTrait::enablePageCaching

Enables page caching.

File

core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php, line 24

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();
}

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