mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
tests/ChillPersonBundle: replace testGenderIsNull with crafted form as html input now prevents user form not selecting a gender
This commit is contained in:
parent
395735e6f7
commit
e4e2138765
@ -114,14 +114,14 @@ class PersonControllerCreateTest extends WebTestCase
|
||||
* @param Form $form
|
||||
* @depends testAddAPersonPage
|
||||
*/
|
||||
public function testGenderIsNull(Form $form)
|
||||
public function testForgedNullGender(Form $form)
|
||||
{
|
||||
$this->fillAValidCreationForm($form);
|
||||
$form->get(self::GENDER_INPUT)->disableValidation()->setValue(NULL);
|
||||
$crawler = $this->getAuthenticatedClient()->submit($form);
|
||||
|
||||
$this->assertEquals(1, $crawler->filter('.error')->count(),
|
||||
'A message is shown if gender is not set');
|
||||
$form->get(self::FIRSTNAME_INPUT)->setValue('john');
|
||||
$form->get(self::LASTNAME_INPUT)->setValue('doe');
|
||||
$date = new \DateTime('1947-02-01');
|
||||
$form->get(self::BIRTHDATE_INPUT)->setValue($date->format('d-m-Y'));
|
||||
$this->client->submit($form);
|
||||
$this->assertResponseStatusCodeSame(500);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user