core/modules/rest/src/Tests/UpdateTest.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/core/modules/rest/src/Tests/UpdateTest.php b/core/modules/rest/src/Tests/UpdateTest.php index 481e790..94cbe2d 100644 --- a/core/modules/rest/src/Tests/UpdateTest.php +++ b/core/modules/rest/src/Tests/UpdateTest.php @@ -368,8 +368,16 @@ protected function patchEntity(EntityInterface $entity, array $read_only_fields, $serialized = $serializer->serialize($normalized, $format, $context); $this->httpRequest($url, 'PATCH', $serialized, $mime_type); - $this->assertResponse(204); - $this->assertResponseBody(''); + $this->assertResponse(200); + $request = Json::decode($serialized); + $response = Json::decode($this->responseBody); + if ($format === 'hal_json') { + unset($request['_links']); + unset($response['_links']); + unset($response['_embedded']); + } + $response = array_diff_key($response, array_combine($read_only_fields, $read_only_fields)); + $this->assertEqual($request, $response); } }