diff --git a/Tests/Controller/PersonAddressControllerTest.php b/Tests/Controller/PersonAddressControllerTest.php index 0f23236a8..6dc35555d 100644 --- a/Tests/Controller/PersonAddressControllerTest.php +++ b/Tests/Controller/PersonAddressControllerTest.php @@ -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|',