X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fhal%2Ftests%2Fsrc%2FFunctional%2FEntityResource%2FHalEntityNormalizationTrait.php;fp=web%2Fcore%2Fmodules%2Fhal%2Ftests%2Fsrc%2FFunctional%2FEntityResource%2FHalEntityNormalizationTrait.php;h=1fc23291b57759d2f9dd8b59ac3dac9ce457249d;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hp=99ab3eb0c9dfa0c7744025335d61af3a90bd786e;hpb=aea91e65e895364e460983b890e295aa5d5540a5;p=yaffs-website diff --git a/web/core/modules/hal/tests/src/Functional/EntityResource/HalEntityNormalizationTrait.php b/web/core/modules/hal/tests/src/Functional/EntityResource/HalEntityNormalizationTrait.php index 99ab3eb0c..1fc23291b 100644 --- a/web/core/modules/hal/tests/src/Functional/EntityResource/HalEntityNormalizationTrait.php +++ b/web/core/modules/hal/tests/src/Functional/EntityResource/HalEntityNormalizationTrait.php @@ -97,22 +97,19 @@ trait HalEntityNormalizationTrait { if ($this->entity->getEntityType()->hasKey('bundle')) { $normalization = $this->getNormalizedPostEntity(); - $normalization['_links']['type'] = Url::fromUri('base:rest/type/' . static::$entityTypeId . '/bad_bundle_name'); $request_options[RequestOptions::BODY] = $this->serializer->encode($normalization, static::$format); - // DX: 400 when incorrect entity type bundle is specified. + // DX: 422 when incorrect entity type bundle is specified. $response = $this->request($method, $url, $request_options); - $this->assertResourceErrorResponse(400, 'No entity type(s) specified', $response); - + $this->assertResourceErrorResponse(422, 'No entity type(s) specified', $response); unset($normalization['_links']['type']); $request_options[RequestOptions::BODY] = $this->serializer->encode($normalization, static::$format); - - // DX: 400 when no entity type bundle is specified. + // DX: 422 when no entity type bundle is specified. $response = $this->request($method, $url, $request_options); - $this->assertResourceErrorResponse(400, 'The type link relation must be specified.', $response); + $this->assertResourceErrorResponse(422, 'The type link relation must be specified.', $response); } }