public function WebformBubbleableMetadataTest::providerTestAppendTo in Webform 6.x
Same name and namespace in other branches
- 8.5 tests/src/Unit/Cache/WebformBubbleableMetadataTest.php \Drupal\Tests\webform\Unit\Cache\WebformBubbleableMetadataTest::providerTestAppendTo()
Provides test data for testAppendTo().
Return value
array
File
- tests/
src/ Unit/ Cache/ WebformBubbleableMetadataTest.php, line 55
Class
- WebformBubbleableMetadataTest
- Tests webform bubbleable metadata.
Namespace
Drupal\Tests\webform\Unit\CacheCode
public function providerTestAppendTo() {
return [
[
(new WebformBubbleableMetadata())
->setCacheContexts([
'bar',
]),
[],
[
'#cache' => [
'contexts' => [
'bar',
],
'tags' => [],
'max-age' => Cache::PERMANENT,
],
'#attached' => [],
],
],
[
(new WebformBubbleableMetadata())
->setCacheContexts([
'bar',
]),
[
'#cache' => [
'contexts' => [
'bar',
],
],
],
[
'#cache' => [
'contexts' => [
'bar',
],
'tags' => [],
'max-age' => Cache::PERMANENT,
],
'#attached' => [],
],
],
[
(new WebformBubbleableMetadata())
->setCacheContexts([
'bar',
'foo',
]),
[
'#cache' => [
'contexts' => [
'bar',
],
],
],
[
'#cache' => [
'contexts' => [
'bar',
'foo',
],
'tags' => [],
'max-age' => Cache::PERMANENT,
],
'#attached' => [],
],
],
[
(new WebformBubbleableMetadata())
->setCacheMaxAge(99),
[],
[
'#cache' => [
'contexts' => [],
'tags' => [],
'max-age' => 99,
],
'#attached' => [],
],
],
[
(new WebformBubbleableMetadata())
->setCacheContexts([
'bar',
]),
[
'#cache' => [
'max-age' => 99,
],
],
[
'#cache' => [
'contexts' => [
'bar',
],
'tags' => [],
'max-age' => 99,
],
'#attached' => [],
],
],
];
}