eZ\Publish\Core\Repository\Tests\Service\Integration\RoleBase::testGetRoleAssignmentsForUser PHP Method

testGetRoleAssignmentsForUser() public method

Test fetching role assignments for specified user.
    public function testGetRoleAssignmentsForUser()
    {
        $roleService = $this->repository->getRoleService();
        $user = $this->repository->getUserService()->loadUser(14);
        $role = $roleService->loadRole(2);
        $roleService->assignRoleToUser($role, $user);
        $userAssignments = $roleService->getRoleAssignmentsForUser($user);
        self::assertInternalType('array', $userAssignments);
        self::assertNotEmpty($userAssignments);
        foreach ($userAssignments as $assignment) {
            self::assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\User\\UserRoleAssignment', $assignment);
        }
    }