/** * Test successful registration */ public function testRegistration() { $crawler = $this->client->request('GET', '/register/'); $form = $crawler->selectButton('Register')->form(); $values = $form->getValues(); $values["fos_user_registration_form[email]"] = '*****@*****.**'; $values["fos_user_registration_form[plainPassword][first]"] = 'user'; $values["fos_user_registration_form[plainPassword][second]"] = 'user'; $values["fos_user_registration_form[firstName]"] = 'First'; $values["fos_user_registration_form[lastName]"] = 'Last'; $form->setValues($values); $this->client->submit($form); $this->assertTrue($this->client->getResponse()->isRedirect()); $user = FakeLogin::getUser($this->container); FakeLogin::removeUser($user, $this->container); }
public static function removeUser(User $user, $container) { FakeLogin::getUserManager($container)->deleteUser($user); }
public function tearDown() { FakeLogin::removeUser($this->user, $this->container); }