fix tests

This commit is contained in:
2021-08-23 18:19:47 +02:00
parent 8fb4a7110e
commit 647bdb2749
2 changed files with 9 additions and 6 deletions

View File

@@ -63,7 +63,7 @@ class PersonControllerCreateTest extends WebTestCase
$creationForm->get(self::LASTNAME_INPUT)->setValue($lastname.'_'.uniqid());
$creationForm->get(self::GENDER_INPUT)->select("man");
$date = new \DateTime('1947-02-01');
$creationForm->get(self::BIRTHDATE_INPUT)->setValue($date->format('d-m-Y'));
$creationForm->get(self::BIRTHDATE_INPUT)->setValue($date->format('Y-m-d'));
return $creationForm;
}
@@ -114,15 +114,18 @@ class PersonControllerCreateTest extends WebTestCase
*
* @param Form $form
* @return string The id of the created person
* @depends testAddAPersonPage
*/
public function testValidForm(Form $form)
public function testValidForm()
{
$client = $this->client;
$crawler = $client->request('GET', '/fr/person/new');
$form = $crawler->selectButton("Ajouter la personne")->form();
$this->fillAValidCreationForm($form);
$client = $this->client;
$crawler = $client->submit($form);
$client->submit($form);
$this->assertTrue((bool)$client->getResponse()->isRedirect(),
$this->assertTrue($client->getResponse()->isRedirect(),
"a valid form redirect to url /{_locale}/person/{personId}/general/edit");
$client->followRedirect();