You are here

public function InformationHeadersExtendTest::testThatExtendedHeadersAreUsedForManagementApiCalls 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 62

Class

InformationHeadersExtendTest
Class InformationHeadersExtendTest

Namespace

Auth0\Tests\Api\Helpers

Code

public function testThatExtendedHeadersAreUsedForManagementApiCalls() {
  $new_headers = self::setExtendedHeaders('test-extend-sdk-2', '2.3.4');
  $api = new MockManagementApi([
    new Response(200),
  ]);
  $api
    ->call()->connections
    ->getAll();
  $headers = $api
    ->getHistoryHeaders();
  $this
    ->assertEquals($new_headers
    ->build(), $headers['Auth0-Client'][0]);
}