You are here

public function InformationHeadersExtendTest::testThatExtendedHeadersAreUsedForAuthenticationApiCalls in Auth0 Single Sign On 8.2

Test that extending the headers works for Management API calls.

Throws

\Exception Unsuccessful HTTP call or empty mock history queue.

File

vendor/auth0/auth0-php/tests/API/Helpers/InformationHeadersExtendTest.php, line 78

Class

InformationHeadersExtendTest
Class InformationHeadersExtendTest

Namespace

Auth0\Tests\Api\Helpers

Code

public function testThatExtendedHeadersAreUsedForAuthenticationApiCalls() {
  $new_headers = self::setExtendedHeaders('test-extend-sdk-3', '3.4.5');
  $api = new MockAuthenticationApi([
    new Response(200),
  ]);
  $api
    ->call()
    ->oauth_token([
    'grant_type' => uniqid(),
  ]);
  $headers = $api
    ->getHistoryHeaders();
  $this
    ->assertEquals($new_headers
    ->build(), $headers['Auth0-Client'][0]);
}