Neos\Flow\Tests\FunctionalTestCase::authenticateRoles PHP Method

authenticateRoles() protected method

The created account is returned for further modification, for example for attaching a Party object to it.
protected authenticateRoles ( array $roleNames ) : Account
$roleNames array A list of roles the new account should have
return Neos\Flow\Security\Account The created account
    protected function authenticateRoles(array $roleNames)
    {
        $account = new \Neos\Flow\Security\Account();
        $roles = array();
        foreach ($roleNames as $roleName) {
            $roles[] = $this->policyService->getRole($roleName);
        }
        $account->setRoles($roles);
        $this->authenticateAccount($account);
        return $account;
    }