public function PasswordGrantTest::testThatPasswordGrantLoginEnforcesUsername in Auth0 Single Sign On 8.2
File
- vendor/
auth0/ auth0-php/ tests/ API/ Authentication/ PasswordGrantTest.php, line 43
Class
- PasswordGrantTest
- Class PasswordGrantTest Tests the Authentication API class, specifically password grants.
Namespace
Auth0\Tests\API\AuthenticationCode
public function testThatPasswordGrantLoginEnforcesUsername() {
$api = new Authentication('test-domain.auth0.com');
try {
$caught_exception = false;
$api
->login_with_default_directory([]);
} catch (ApiException $e) {
$caught_exception = $this
->errorHasString($e, 'username is mandatory');
}
$this
->assertTrue($caught_exception);
try {
$caught_exception = false;
$api
->login([]);
} catch (ApiException $e) {
$caught_exception = $this
->errorHasString($e, 'username is mandatory');
}
$this
->assertTrue($caught_exception);
}