function JsonApiDocumentTopLevelNormalizerTest::testDenormalize
Tests denormalize.
@legacy-covers ::denormalize
Attributes
#[DataProvider('denormalizeProvider')]
File
-
core/
modules/ jsonapi/ tests/ src/ Unit/ Normalizer/ JsonApiDocumentTopLevelNormalizerTest.php, line 97
Class
- JsonApiDocumentTopLevelNormalizerTest
- Tests Drupal\jsonapi\Normalizer\JsonApiDocumentTopLevelNormalizer.
Namespace
Drupal\Tests\jsonapi\Unit\NormalizerCode
public function testDenormalize($input, $expected) : void {
$resource_type = new ResourceType('node', 'article', FieldableEntityInterface::class);
$resource_type->setRelatableResourceTypes([]);
$context = [
'resource_type' => $resource_type,
];
$denormalized = $this->normalizer
->denormalize($input, NULL, 'api_json', $context);
$this->assertSame($expected, $denormalized);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.