mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
move utilities at the end of the file
This commit is contained in:
parent
d554407dce
commit
72182a8c77
@ -134,6 +134,30 @@ class PersonControllerUpdateTest extends WebTestCase
|
||||
'the value '.$field.' is updated in db');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @dataProvider providesInvalidFieldsValues
|
||||
* @param string $field
|
||||
* @param string $value
|
||||
*/
|
||||
public function testInvalidFields($field, $value)
|
||||
{
|
||||
$crawler = $this->client->request('GET', $this->editUrl);
|
||||
|
||||
$form = $crawler->selectButton('Submit')
|
||||
->form();
|
||||
$form->get('chill_personbundle_person['.$field.']')
|
||||
->setValue($value);
|
||||
|
||||
$crawler = $this->client->submit($form);
|
||||
|
||||
$this->assertFalse($this->client->getResponse()->isRedirect(),
|
||||
'the page is not redirected to /general');
|
||||
$this->assertGreaterThan(0, $crawler->filter('.error')->count(),
|
||||
'a element .error is shown');
|
||||
}
|
||||
|
||||
/**
|
||||
* provide valid values to test, with field name and
|
||||
* a function to find the value back from person entity
|
||||
@ -161,29 +185,6 @@ class PersonControllerUpdateTest extends WebTestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @dataProvider providesInvalidFieldsValues
|
||||
* @param string $field
|
||||
* @param string $value
|
||||
*/
|
||||
public function testInvalidFields($field, $value)
|
||||
{
|
||||
$crawler = $this->client->request('GET', $this->editUrl);
|
||||
|
||||
$form = $crawler->selectButton('Submit')
|
||||
->form();
|
||||
$form->get('chill_personbundle_person['.$field.']')
|
||||
->setValue($value);
|
||||
|
||||
$crawler = $this->client->submit($form);
|
||||
|
||||
$this->assertFalse($this->client->getResponse()->isRedirect(),
|
||||
'the page is not redirected to /general');
|
||||
$this->assertGreaterThan(0, $crawler->filter('.error')->count(),
|
||||
'a element .error is shown');
|
||||
}
|
||||
|
||||
public function providesInvalidFieldsValues()
|
||||
{
|
||||
return array(
|
||||
|
Loading…
x
Reference in New Issue
Block a user