public function NoOptimizeCacheContext::getCacheableMetadata in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php \Drupal\Tests\Core\Cache\Context\NoOptimizeCacheContext::getCacheableMetadata()
- 9 core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php \Drupal\Tests\Core\Cache\Context\NoOptimizeCacheContext::getCacheableMetadata()
File
- core/
tests/ Drupal/ Tests/ Core/ Cache/ Context/ CacheContextsManagerTest.php, line 330 - Contains \Drupal\Tests\Core\Cache\Context\CacheContextsManagerTest.
Class
- NoOptimizeCacheContext
- Non-optimizable context class.
Namespace
Drupal\Tests\Core\Cache\ContextCode
public function getCacheableMetadata() {
$cacheable_metadata = new CacheableMetadata();
return $cacheable_metadata
->setCacheMaxAge(0);
}