You are here

public function GrantsTestMocked::testGrantsDelete in Auth0 Single Sign On 8.2

Test that delete requests properly.

Return value

void

Throws

\Exception Unsuccessful HTTP call.

File

vendor/auth0/auth0-php/tests/API/Management/GrantsMockedTest.php, line 323

Class

GrantsTestMocked
Class GrantsTestMocked.

Namespace

Auth0\Tests\API\Management

Code

public function testGrantsDelete() {
  $api = new MockManagementApi([
    new Response(204),
  ]);
  $id = uniqid();
  $api
    ->call()
    ->grants()
    ->delete($id);
  $this
    ->assertEquals('DELETE', $api
    ->getHistoryMethod());
  $this
    ->assertEquals('https://api.test.local/api/v2/grants/' . $id, $api
    ->getHistoryUrl());
  $this
    ->assertEmpty($api
    ->getHistoryQuery());
  $headers = $api
    ->getHistoryHeaders();
  $this
    ->assertEquals('Bearer __api_token__', $headers['Authorization'][0]);
  $this
    ->assertEquals(self::$telemetry, $headers['Auth0-Client'][0]);
}