function ResourceIdentifierNormalizerTest::testDenormalizeInvalidResource
Same name in other branches
- 9 core/modules/jsonapi/tests/src/Unit/Normalizer/ResourceIdentifierNormalizerTest.php \Drupal\Tests\jsonapi\Unit\Normalizer\ResourceIdentifierNormalizerTest::testDenormalizeInvalidResource()
- 8.9.x core/modules/jsonapi/tests/src/Unit/Normalizer/ResourceIdentifierNormalizerTest.php \Drupal\Tests\jsonapi\Unit\Normalizer\ResourceIdentifierNormalizerTest::testDenormalizeInvalidResource()
- 10 core/modules/jsonapi/tests/src/Unit/Normalizer/ResourceIdentifierNormalizerTest.php \Drupal\Tests\jsonapi\Unit\Normalizer\ResourceIdentifierNormalizerTest::testDenormalizeInvalidResource()
@covers ::denormalize @dataProvider denormalizeInvalidResourceProvider
File
-
core/
modules/ jsonapi/ tests/ src/ Unit/ Normalizer/ ResourceIdentifierNormalizerTest.php, line 155
Class
- ResourceIdentifierNormalizerTest
- @coversDefaultClass \Drupal\jsonapi\Normalizer\ResourceIdentifierNormalizer @group jsonapi
Namespace
Drupal\Tests\jsonapi\Unit\NormalizerCode
public function testDenormalizeInvalidResource($data, $field_name) : void {
$context = [
'resource_type' => $this->resourceType,
'related' => $field_name,
'target_entity' => $this->prophesize(FieldableEntityInterface::class)
->reveal(),
];
$this->expectException(BadRequestHttpException::class);
$this->normalizer
->denormalize($data, NULL, 'api_json', $context);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.