You are here

public function ConnectionsTestMocked::testConnectionsDelete in Auth0 Single Sign On 8.2

Test a basic delete connection request.

Return value

void

Throws

\Exception Unsuccessful HTTP call.

File

vendor/auth0/auth0-php/tests/API/Management/ConnectionsMockedTest.php, line 267

Class

ConnectionsTestMocked
Class ConnectionsTestMocked.

Namespace

Auth0\Tests\API\Management

Code

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