diff --git a/core/modules/rest/src/Tests/ReadTest.php b/core/modules/rest/src/Tests/ReadTest.php index c730b89..9084f93 100644 --- a/core/modules/rest/src/Tests/ReadTest.php +++ b/core/modules/rest/src/Tests/ReadTest.php @@ -60,7 +60,9 @@ public function testRead() { // Try to read an entity that does not exist. $response = $this->httpRequest($entity_type . '/9999', 'GET', NULL, $this->defaultMimeType); $this->assertResponse(404); - $this->assertText(Json::encode(['A fatal error occurred: The "' . $entity_type . '" parameter was not converted for the path']), 'Response message is correct.'); + $path = $entity_type == 'node' ? '/node/{node}' : '/entity_test/{entity_test}'; + $expected_message = Json::encode(['A fatal error occurred: The "' . $entity_type . '" parameter was not converted for the path "' . $path . '" (route name: "rest.entity.' . $entity_type . '.GET.hal_json")']); + $this->assertIdentical($expected_message, $response, 'Response message is correct.'); // Make sure that field level access works and that the according field is // not available in the response. Only applies to entity_test. @@ -86,7 +88,8 @@ public function testRead() { $this->drupalLogin($account); $response = $this->httpRequest($account->getSystemPath(), 'GET', NULL, $this->defaultMimeType); $this->assertResponse(404); - $this->assertIdentical('{}', $response); + $expected_message = Json::encode(['A fatal error occurred: Unable to find the controller for path "/user/4". Maybe you forgot to add the matching route in your routing configuration?']); + $this->assertIdentical($expected_message, $response); } /**