You are here

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

Test that an add permissions call throws an exception if permissions 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 936

Class

UsersMockedTest
Class UsersMockedTest.

Namespace

Auth0\Tests\API\Management

Code

public function testThatAddPermissionsThrowsExceptionIfPermissionsAreMissing() {
  $api = new MockManagementApi();
  try {
    $api
      ->call()
      ->users()
      ->addPermissions('__test_user_id__', []);
    $caught_exception = false;
  } catch (InvalidPermissionsArrayException $e) {
    $caught_exception = true;
  }
  $this
    ->assertTrue($caught_exception);
}