public function RendererTest::providerTestAddCacheableDependency in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Core/Render/RendererTest.php \Drupal\Tests\Core\Render\RendererTest::providerTestAddCacheableDependency()
File
- core/tests/Drupal/Tests/Core/Render/RendererTest.php, line 790
- Contains \Drupal\Tests\Core\Render\RendererTest.
Class
- RendererTest
- @coversDefaultClass \Drupal\Core\Render\Renderer
@group Render
Namespace
Drupal\Tests\Core\Render
Code
public function providerTestAddCacheableDependency() {
return [
[
[],
new TestCacheableDependency([], [], Cache::PERMANENT),
[
'#cache' => [
'contexts' => [],
'tags' => [],
'max-age' => Cache::PERMANENT,
],
],
],
[
[],
new TestCacheableDependency([
'user.roles',
], [
'foo',
], Cache::PERMANENT),
[
'#cache' => [
'contexts' => [
'user.roles',
],
'tags' => [
'foo',
],
'max-age' => Cache::PERMANENT,
],
],
],
[
[
'#cache' => [
'contexts' => [
'theme',
],
'tags' => [
'bar',
],
'max-age' => 600,
],
],
new TestCacheableDependency([
'user.roles',
], [
'foo',
], Cache::PERMANENT),
[
'#cache' => [
'contexts' => [
'theme',
'user.roles',
],
'tags' => [
'bar',
'foo',
],
'max-age' => 600,
],
],
],
[
[
'#cache' => [
'contexts' => [
'theme',
],
'tags' => [
'bar',
],
'max-age' => 600,
],
],
new \stdClass(),
[
'#cache' => [
'contexts' => [
'theme',
],
'tags' => [
'bar',
],
'max-age' => 0,
],
],
],
];
}