diff --git a/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php b/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php index c509027..6e637c4 100644 --- a/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php +++ b/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php @@ -48,7 +48,7 @@ public function testRead() { // Try to read the resource as an anonymous user, which should not work. $response = $this->httpRequest('entity/' . $entity_type . '/' . $entity->id(), 'GET', NULL, $this->defaultMimeType); $this->assertResponse('401', 'HTTP response code is 401 when the request is not authenticated and the user is anonymous.'); - $this->assertText(t('A fatal error occurred: No authentication credentials provided.')); + $this->assertText('A fatal error occurred: No authentication credentials provided.'); // Create a user account that has the required permissions to read // resources via the REST API, but the request is authenticated @@ -61,13 +61,14 @@ public function testRead() { // Try to read the resource with session cookie authentication, which is // not enabled and should not work. $response = $this->httpRequest('entity/' . $entity_type . '/' . $entity->id(), 'GET', NULL, $this->defaultMimeType); - $this->assertResponse('403', 'HTTP response code is 403 when the request is not authenticated.'); + $this->assertResponse('403', 'HTTP response code is 403 when the request is authenticated but not authorized.'); $this->drupalLogout(); // Now read it with the Basic authentication which is enabled and should // work. $response = $this->basicAuthGet('entity/' . $entity_type . '/' . $entity->id(), $account->getUsername(), $account->pass_raw); - $this->assertResponse('200', 'HTTP response code is 200 for successfuly authenticated requests.'); + $this->assertResponse('200', 'HTTP response code is 200 for successfuly authorized requests.'); + $this->curlClose(); } /**