Issue #2099679 by linclark: Fixed Changing the order of asserts in AuthTest::testRead makes them fail.

8.0.x
Nathaniel Catchpole 2013-10-13 13:06:36 +01:00
parent cc36f2cabc
commit 8be763a670
1 changed files with 6 additions and 0 deletions

View File

@ -50,6 +50,9 @@ class AuthTest extends RESTTestBase {
$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 @@ class AuthTest extends RESTTestBase {
$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);