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; }