You are here

protected function BasicAuthResourceTestTrait::getAuthenticationRequestOptions in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/rest/tests/src/Functional/BasicAuthResourceTestTrait.php \Drupal\Tests\rest\Functional\BasicAuthResourceTestTrait::getAuthenticationRequestOptions()
  2. 9 core/modules/rest/tests/src/Functional/BasicAuthResourceTestTrait.php \Drupal\Tests\rest\Functional\BasicAuthResourceTestTrait::getAuthenticationRequestOptions()
1 call to BasicAuthResourceTestTrait::getAuthenticationRequestOptions()
LayoutRestTestBase::request in core/modules/layout_builder/tests/src/Functional/Rest/LayoutRestTestBase.php
Performs a HTTP request. Wraps the Guzzle HTTP client.

File

core/modules/rest/tests/src/Functional/BasicAuthResourceTestTrait.php, line 23

Class

BasicAuthResourceTestTrait
Trait for ResourceTestBase subclasses testing $auth=basic_auth.

Namespace

Drupal\Tests\rest\Functional

Code

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