You are here

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

Test that a remove roles call throws an exception if roles are missing.

Return value

void

Throws

\Exception Should not be thrown in this test.

File

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

Class

UsersMockedTest
Class UsersMockedTest.

Namespace

Auth0\Tests\API\Management

Code

public function testThatRemoveRolesThrowsExceptionIfRolesAreMissing() {
  $api = new MockManagementApi();
  try {
    $api
      ->call()
      ->users()
      ->removeRoles('__test_user_id__', []);
    $caught_message = '';
  } catch (EmptyOrInvalidParameterException $e) {
    $caught_message = $e
      ->getMessage();
  }
  $this
    ->assertContains('Empty or invalid roles', $caught_message);
}