fix test for inserting addresses

This commit is contained in:
Julien Fastré 2016-11-13 21:41:51 +01:00
parent 4c265ef293
commit bd78722a6b

View File

@ -125,12 +125,17 @@ class PersonAddressControllerTest extends WebTestCase
$this->assertTrue($this->client->getResponse()->isSuccessful()); $this->assertTrue($this->client->getResponse()->isSuccessful());
// get the form and populate the most obvious fields (postcode will come later)
$form = $crawler->selectButton('Envoi')->form(array( $form = $crawler->selectButton('Envoi')->form(array(
'address[streetAddress1]' => 'Rue de la Paix, 50', 'address[streetAddress1]' => 'Rue de la Paix, 50',
'address[streetAddress2]' => $this->postalCode->getId(), 'address[streetAddress2]' => $this->postalCode->getId(),
'address[validFrom]' => '15-01-2016' 'address[validFrom]' => '15-01-2016'
)); ));
// select a random postal code
$values = $form['address[postCode]']->availableOptionValues();
$form['address[postCode]']->setValue($values[array_rand($values)]);
$this->client->submit($form); $this->client->submit($form);
$crawler = $this->client->followRedirect(); $crawler = $this->client->followRedirect();