Skip to content
Snippets Groups Projects
Commit 8be763a6 authored by catch's avatar catch
Browse files

Issue #2099679 by linclark: Fixed Changing the order of asserts in...

Issue #2099679 by linclark: Fixed Changing the order of asserts in AuthTest::testRead makes them fail.
parent cc36f2ca
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment