Issue #2099679 by linclark: Fixed Changing the order of asserts in AuthTest::testRead makes them fail.
parent
cc36f2cabc
commit
8be763a670
|
@ -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->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.');
|
$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
|
// Create a user account that has the required permissions to read
|
||||||
// resources via the REST API, but the request is authenticated
|
// resources via the REST API, but the request is authenticated
|
||||||
// with session cookies.
|
// with session cookies.
|
||||||
|
@ -63,6 +66,9 @@ class AuthTest extends RESTTestBase {
|
||||||
$response = $this->httpRequest('entity/' . $entity_type . '/' . $entity->id(), 'GET', NULL, $this->defaultMimeType);
|
$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.');
|
$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
|
// Now read it with the Basic authentication which is enabled and should
|
||||||
// work.
|
// work.
|
||||||
$response = $this->basicAuthGet('entity/' . $entity_type . '/' . $entity->id(), $account->getUsername(), $account->pass_raw);
|
$response = $this->basicAuthGet('entity/' . $entity_type . '/' . $entity->id(), $account->getUsername(), $account->pass_raw);
|
||||||
|
|
Loading…
Reference in New Issue