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,14 +125,19 @@ class PersonAddressControllerTest extends WebTestCase
$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(
'address[streetAddress1]' => 'Rue de la Paix, 50',
'address[streetAddress2]' => $this->postalCode->getId(),
'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);
$crawler = $this->client->followRedirect();
$this->assertRegexp('|/fr/person/[0-9]{1,}/address/list|',