public function ClientGrantsTest::testCreateGrantExceptions in Auth0 Single Sign On 8.2
Test that create method throws errors correctly.
Return value
void
Throws
\Exception Thrown by the Guzzle HTTP client when there is a problem with the API call.
File
- vendor/
auth0/ auth0-php/ tests/ API/ Management/ ClientGrantsTest.php, line 203
Class
- ClientGrantsTest
- Class ClientGrantsTest. Tests the Auth0\SDK\API\Management\ClientGrants class.
Namespace
Auth0\Tests\APICode
public function testCreateGrantExceptions() {
$throws_missing_client_id_exception = false;
try {
self::$api
->create('', self::$apiIdentifier, []);
} catch (CoreException $e) {
$throws_missing_client_id_exception = $this
->errorHasString($e, 'Empty or invalid "client_id" parameter');
}
$this
->assertTrue($throws_missing_client_id_exception);
$throws_missing_audience_exception = false;
try {
self::$api
->create(self::$env['APP_CLIENT_ID'], '', []);
} catch (CoreException $e) {
$throws_missing_audience_exception = $this
->errorHasString($e, 'Empty or invalid "audience" parameter');
}
$this
->assertTrue($throws_missing_audience_exception);
}