public function ResourceIdentifierNormalizerTest::testDenormalize in Drupal 9
Same name and namespace in other branches
- 8 core/modules/jsonapi/tests/src/Unit/Normalizer/ResourceIdentifierNormalizerTest.php \Drupal\Tests\jsonapi\Unit\Normalizer\ResourceIdentifierNormalizerTest::testDenormalize()
- 10 core/modules/jsonapi/tests/src/Unit/Normalizer/ResourceIdentifierNormalizerTest.php \Drupal\Tests\jsonapi\Unit\Normalizer\ResourceIdentifierNormalizerTest::testDenormalize()
@covers ::denormalize @dataProvider denormalizeProvider
File
- core/
modules/ jsonapi/ tests/ src/ Unit/ Normalizer/ ResourceIdentifierNormalizerTest.php, line 110
Class
- ResourceIdentifierNormalizerTest
- @coversDefaultClass \Drupal\jsonapi\Normalizer\ResourceIdentifierNormalizer @group jsonapi
Namespace
Drupal\Tests\jsonapi\Unit\NormalizerCode
public function testDenormalize($input, $field_name, $expected) {
$entity = $this
->prophesize(FieldableEntityInterface::class);
$context = [
'resource_type' => $this->resourceType,
'related' => $field_name,
'target_entity' => $entity
->reveal(),
];
$denormalized = $this->normalizer
->denormalize($input, NULL, 'api_json', $context);
$this
->assertEquals($expected, $denormalized);
}