You are here

public function RolesTestMocked::testThatGetRolePermissionsRequestWithEmptyRoleIdThrowsException in Auth0 Single Sign On 8.2

Test that an empty role ID throws an exception when trying to get permissions for a role.

Return value

void

Throws

\Exception Should not be thrown in this test.

File

vendor/auth0/auth0-php/tests/API/Management/RolesMockedTest.php, line 266

Class

RolesTestMocked
Class RolesTestMocked.

Namespace

Auth0\Tests\API\Management

Code

public function testThatGetRolePermissionsRequestWithEmptyRoleIdThrowsException() {
  $api = new MockManagementApi();
  try {
    $api
      ->call()
      ->roles()
      ->getPermissions('');
    $exception_message = '';
  } catch (EmptyOrInvalidParameterException $e) {
    $exception_message = $e
      ->getMessage();
  }
  $this
    ->assertContains('Empty or invalid role_id', $exception_message);
}