tests/src/Functional/CommentTest.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/src/Functional/CommentTest.php b/tests/src/Functional/CommentTest.php index 0da25e7..b95e1b0 100644 --- a/tests/src/Functional/CommentTest.php +++ b/tests/src/Functional/CommentTest.php @@ -321,13 +321,18 @@ class CommentTest extends ResourceTestBase { // DX: 422 when missing 'entity_id' field. $request_options[RequestOptions::BODY] = Json::encode($remove_field($this->getPostDocument(), 'relationships', 'entity_id')); $response = $this->request('POST', $url, $request_options); - $this->assertResourceErrorResponse(422, 'entity_id: This value should not be null.', NULL, $response, '/data/attributes/entity_id'); + if (floatval(\Drupal::VERSION) >= 8.7) { + $this->assertResourceErrorResponse(422, 'entity_id: This value should not be null.', NULL, $response, '/data/attributes/entity_id'); + } + else { + $this->assertSame(500, $response->getStatusCode()); + } // DX: 422 when missing 'field_name' field. $request_options[RequestOptions::BODY] = Json::encode($remove_field($this->getPostDocument(), 'attributes', 'field_name')); $response = $this->request('POST', $url, $request_options); // @todo Uncomment, remove next line in https://www.drupal.org/node/2820364. - $this->assertSame(201, $response->getStatusCode()); + $this->assertSame(floatval(\Drupal::VERSION) >= 8.7 ? 201 : 500, $response->getStatusCode()); // $this->assertResourceErrorResponse(422, 'Unprocessable Entity', 'field_name: This value should not be null.', $response); // @codingStandardsIgnoreEnd }