diff --git a/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php b/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php index 7c40096..2be8ff3 100644 --- a/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php +++ b/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php @@ -50,6 +50,9 @@ public function testRead() { $this->assertResponse('401', 'HTTP response code is 401 when the request is not authenticated and the user is anonymous.'); $this->assertText('A fatal error occurred: No authentication credentials provided.'); + // Ensure that cURL settings/headers aren't carried over to next request. + unset($this->curlHandle); + // Create a user account that has the required permissions to read // resources via the REST API, but the request is authenticated // with session cookies. @@ -63,6 +66,9 @@ public function testRead() { $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.'); + // Ensure that cURL settings/headers aren't carried over to next request. + unset($this->curlHandle); + // 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);