function LocalTaskDefaultTest::testCacheabilityMetadata
Same name and namespace in other branches
- 10 core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php \Drupal\Tests\Core\Menu\LocalTaskDefaultTest::testCacheabilityMetadata()
- 9 core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php \Drupal\Tests\Core\Menu\LocalTaskDefaultTest::testCacheabilityMetadata()
- 8.9.x core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php \Drupal\Tests\Core\Menu\LocalTaskDefaultTest::testCacheabilityMetadata()
Tests cacheability metadata.
@legacy-covers ::getCacheContexts @legacy-covers ::getCacheTags @legacy-covers ::getCacheMaxAge
File
-
core/
tests/ Drupal/ Tests/ Core/ Menu/ LocalTaskDefaultTest.php, line 352
Class
Namespace
Drupal\Tests\Core\MenuCode
public function testCacheabilityMetadata() : void {
$this->pluginDefinition['cache_contexts'] = [
'route',
];
$this->pluginDefinition['cache_tags'] = [
'kitten',
];
$this->pluginDefinition['cache_max_age'] = 3600;
$this->setupLocalTaskDefault();
$this->assertEquals([
'route',
], $this->localTaskBase
->getCacheContexts());
$this->assertEquals([
'kitten',
], $this->localTaskBase
->getCacheTags());
$this->assertEquals(3600, $this->localTaskBase
->getCacheMaxAge());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.