You are here

public function UsersMockedTest::testThatGenerateRecoveryCodeThrowsExceptionIfUserIdIsMissing in Auth0 Single Sign On 8.2

Test that a generate recovery code call throws an exception if the user ID is missing.

Return value

void

Throws

\Exception Should not be thrown in this test.

File

vendor/auth0/auth0-php/tests/API/Management/UsersMockedTest.php, line 1052

Class

UsersMockedTest
Class UsersMockedTest.

Namespace

Auth0\Tests\API\Management

Code

public function testThatGenerateRecoveryCodeThrowsExceptionIfUserIdIsMissing() {
  $api = new MockManagementApi();
  try {
    $api
      ->call()
      ->users()
      ->generateRecoveryCode('');
    $caught_message = '';
  } catch (EmptyOrInvalidParameterException $e) {
    $caught_message = $e
      ->getMessage();
  }
  $this
    ->assertContains('Empty or invalid user_id', $caught_message);
}