You are here

protected function ResourceTestBase::getAuthenticationRequestOptions in Drupal 10

Same name in this branch
  1. 10 core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\jsonapi\Functional\ResourceTestBase::getAuthenticationRequestOptions()
  2. 10 core/modules/rest/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\rest\Functional\ResourceTestBase::getAuthenticationRequestOptions()
Same name and namespace in other branches
  1. 8 core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\jsonapi\Functional\ResourceTestBase::getAuthenticationRequestOptions()
  2. 9 core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\jsonapi\Functional\ResourceTestBase::getAuthenticationRequestOptions()

Returns Guzzle request options for authentication.

Return value

array Guzzle request options to use for authentication.

See also

\GuzzleHttp\ClientInterface::request()

File

core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php, line 2562

Class

ResourceTestBase
Subclass this for every JSON:API resource type.

Namespace

Drupal\Tests\jsonapi\Functional

Code

protected function getAuthenticationRequestOptions() {
  return [
    'headers' => [
      'Authorization' => 'Basic ' . base64_encode($this->account->name->value . ':' . $this->account->passRaw),
    ],
  ];
}