Neos\Flow\Tests\Behavior\Features\Bootstrap\SecurityOperationsTrait::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 ) : Neos\Flow\Security\Accountt
$roleNames array A list of roles the new account should have
return Neos\Flow\Security\Accountt The created account
    protected function authenticateRoles(array $roleNames)
    {
        $account = new Security\Account();
        $account->setAccountIdentifier('TestAccount');
        $roles = [];
        foreach ($roleNames as $roleName) {
            $roles[] = $this->policyService->getRole($roleName);
        }
        $account->setRoles($roles);
        $this->authenticateAccount($account);
        return $account;
    }