Skip to content

Instantly share code, notes, and snippets.

@kalifg
Created March 20, 2013 15:58
Show Gist options
  • Save kalifg/5205851 to your computer and use it in GitHub Desktop.
Save kalifg/5205851 to your computer and use it in GitHub Desktop.
protected function loginAs(User $user)
{
$qCodoUser = \User::Load($user->getUserId(), true);
\UserSecurity::Login($qCodoUser, false);
$this->user = $user;
}
protected function loginAsUsername($username)
{
$user = $this->get('user.user_manager')->findUserByUsername($username);
$this->loginAs($user);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment