From 72182a8c77760c48b5a620b4b551df34135b79cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 30 Jan 2015 18:02:09 +0100 Subject: [PATCH] move utilities at the end of the file --- .../Controller/PersonControllerUpdateTest.php | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/Tests/Controller/PersonControllerUpdateTest.php b/Tests/Controller/PersonControllerUpdateTest.php index 20b423151..1eba88e23 100644 --- a/Tests/Controller/PersonControllerUpdateTest.php +++ b/Tests/Controller/PersonControllerUpdateTest.php @@ -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(