You are here

public function ClientsTest::testThatCreateRequestThrowsExceptionIfNameKeyIsMissing in Auth0 Single Sign On 8.2

Throws

\Exception

File

vendor/auth0/auth0-php/tests/API/Management/ClientsTest.php, line 133

Class

ClientsTest
Class ClientsTest

Namespace

Auth0\Tests\API\Management

Code

public function testThatCreateRequestThrowsExceptionIfNameKeyIsMissing() {
  $api = new Management(uniqid(), uniqid());
  try {
    $api
      ->clients()
      ->create([
      'app_type' => '__test_app_type__',
    ]);
    $exception_message = 'No exception caught';
  } catch (\Exception $e) {
    $exception_message = $e
      ->getMessage();
  }
  $this
    ->assertStringStartsWith('Missing required "name" field', $exception_message);
}