You are here

protected function ResourceTestBase::getAuthenticationRequestOptions in JSON:API 8.2

Same name and namespace in other branches
  1. 8 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()

30 calls to ResourceTestBase::getAuthenticationRequestOptions()
CommentTest::testCollectionFilterAccess in tests/src/Functional/CommentTest.php
CommentTest::testPostIndividualDxWithoutCriticalBaseFields in tests/src/Functional/CommentTest.php
Tests POSTing a comment without critical base fields.
CommentTest::testPostIndividualSkipCommentApproval in tests/src/Functional/CommentTest.php
Tests POSTing a comment with and without 'skip comment approval'.
ConfigurableLanguageTest::testGetIndividualDefaultConfig in tests/src/Functional/ConfigurableLanguageTest.php
Test a GET request for a default config entity, which has a _core key.
FileTest::testCollectionFilterAccess in tests/src/Functional/FileTest.php

... See full list

File

tests/src/Functional/ResourceTestBase.php, line 2473

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),
    ],
  ];
}