You are here

public function ResourceServersTest::testDelete in Auth0 Single Sign On 8.2

Test deleting the Resource Server created above.

Return value

void

Throws

CoreException Thrown if the identifier parameter or data field is empty or is not a string.

\Exception Thrown by the HTTP client when there is a problem with the API call.

File

vendor/auth0/auth0-php/tests/API/Management/ResourceServersTest.php, line 186

Class

ResourceServersTest
Class ResourceServersTest.

Namespace

Auth0\Tests\API\Management

Code

public function testDelete() {
  $response = self::$api
    ->delete(self::$serverIdentifier);
  usleep(AUTH0_PHP_TEST_INTEGRATION_SLEEP);

  // Look for the resource server we just deleted.
  $get_server_throws_error = false;
  try {
    self::$api
      ->get(self::$serverIdentifier);
    usleep(AUTH0_PHP_TEST_INTEGRATION_SLEEP);
  } catch (ClientException $e) {
    $get_server_throws_error = 404 === $e
      ->getCode();
  }
  $this
    ->assertNull($response);
  $this
    ->assertTrue($get_server_throws_error);
}