public function testLoginNewUser()
 {
     $client = static::createClient();
     $kernel = static::createKernel();
     $kernel->boot();
     $em = $kernel->getContainer()->get('doctrine.orm.entity_manager');
     $fonction = $em->getRepository('IuchBundle:Fonction')->findOneByNom('testFonction');
     $service = $em->getRepository('IuchBundle:Service')->findOneByNom('testService');
     // On Créé un nouvel utilisateur
     $user = new User();
     $user->setUsername('TestUser');
     $user->setPlainPassword('081187');
     $user->setFonction($fonction);
     $user->setService($service);
     $em->persist($user);
     $em->flush();
     $crawler = $client->request('GET', '/login');
     $form = $crawler->selectButton('_submit')->form();
     // set some values
     $form['_username'] = '******';
     $form['_password'] = '******';
     // submit the form
     $crawler = $client->submit($form);
     $this->assertTrue($client->getResponse()->isRedirect('/logout/change-password'));
     // On kill le nouvel utilisateur
     $em->remove($user);
     $em->flush();
 }