move utilities at the end of the file

This commit is contained in:
Julien Fastré 2015-01-30 18:02:09 +01:00
parent d554407dce
commit 72182a8c77

View File

@ -134,6 +134,30 @@ class PersonControllerUpdateTest extends WebTestCase
'the value '.$field.' is updated in db'); '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 * provide valid values to test, with field name and
* a function to find the value back from person entity * 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() public function providesInvalidFieldsValues()
{ {
return array( return array(