public function JsonApiDocumentTopLevelNormalizerTest::testCacheableMetadataProvider in JSON:API 8.2
Same name and namespace in other branches
- 8 tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php \Drupal\Tests\jsonapi\Kernel\Normalizer\JsonApiDocumentTopLevelNormalizerTest::testCacheableMetadataProvider()
Provides test cases for asserting cacheable metadata behavior.
File
- tests/
src/ Kernel/ Normalizer/ JsonApiDocumentTopLevelNormalizerTest.php, line 705
Class
- JsonApiDocumentTopLevelNormalizerTest
- @coversDefaultClass \Drupal\jsonapi\Normalizer\JsonApiDocumentTopLevelNormalizer @group jsonapi @group legacy
Namespace
Drupal\Tests\jsonapi\Kernel\NormalizerCode
public function testCacheableMetadataProvider() {
$cacheable_metadata = function ($metadata) {
return CacheableMetadata::createFromRenderArray([
'#cache' => $metadata,
]);
};
return [
[
$cacheable_metadata([
'contexts' => [
'languages:language_interface',
],
]),
[
'node--article' => 'body',
],
],
];
}