Exemplo n.º 1
0
 /**
  *  login action test
  */
 public function testLoginAction()
 {
     $form = new \User\Form\LoginForm('form-login', ['serviceLocator' => $this->getApplicationServiceLocator()]);
     $userData = ['name' => 'User', 'email' => '*****@*****.**', 'password' => '123456'];
     $this->createUser($userData, \User\Entity\User::ROLE_USER);
     $postData = ['email' => $userData['email'], 'password' => $userData['password'], 'security' => $form->get('security')->getValue()];
     $this->dispatch('/user/auth/login', 'POST', $postData);
     $this->assertResponseStatusCode(302);
     $this->assertRedirectTo('/');
 }