/** * Do login with username * * @param string $username */ private function doLogin($username = '******') { $crawler = $this->client->request('GET', $this->getUrl('fos_user_security_login', array())); $form = $crawler->selectButton('_submit')->form(array('_username' => $username, '_password' => 'qwerty')); $this->client->submit($form); $this->assertTrue($this->client->getResponse()->isRedirect()); $this->client->followRedirects(); }