mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +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
|
* @param Form $form
|
||||||
* @depends testAddAPersonPage
|
* @depends testAddAPersonPage
|
||||||
*/
|
*/
|
||||||
public function testGenderIsNull(Form $form)
|
public function testForgedNullGender(Form $form)
|
||||||
{
|
{
|
||||||
$this->fillAValidCreationForm($form);
|
$form->get(self::FIRSTNAME_INPUT)->setValue('john');
|
||||||
$form->get(self::GENDER_INPUT)->disableValidation()->setValue(NULL);
|
$form->get(self::LASTNAME_INPUT)->setValue('doe');
|
||||||
$crawler = $this->getAuthenticatedClient()->submit($form);
|
$date = new \DateTime('1947-02-01');
|
||||||
|
$form->get(self::BIRTHDATE_INPUT)->setValue($date->format('d-m-Y'));
|
||||||
$this->assertEquals(1, $crawler->filter('.error')->count(),
|
$this->client->submit($form);
|
||||||
'A message is shown if gender is not set');
|
$this->assertResponseStatusCodeSame(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user