public function RolesTestMocked::testThatAddRolePermissionsRequestWithEmptyPermissionsThrowsException in Auth0 Single Sign On 8.2
Test that an invalid permissions array throws an exception when trying to add 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 359 
Class
- RolesTestMocked
- Class RolesTestMocked.
Namespace
Auth0\Tests\API\ManagementCode
public function testThatAddRolePermissionsRequestWithEmptyPermissionsThrowsException() {
  $api = new MockManagementApi();
  try {
    $api
      ->call()
      ->roles()
      ->addPermissions('__test_role_id__', []);
    $caught_exception = false;
  } catch (InvalidPermissionsArrayException $e) {
    $caught_exception = true;
  }
  $this
    ->assertTrue($caught_exception);
}