diff --git a/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php b/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php index 7c40096..f94e460 100644 --- a/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php +++ b/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php @@ -58,15 +58,16 @@ public function testRead() { $account = $this->drupalCreateUser($permissions); $this->drupalLogin($account); + // 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 authorized requests.'); + // 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('401', 'HTTP response code is 401 when the request is authenticated but not authorized.'); - // 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 authorized requests.'); $this->curlClose(); }