From 5525cd5ded4aeb6c2f917ea67d4c7ea2c671417d Mon Sep 17 00:00:00 2001 From: MedUnes Date: Fri, 9 Jun 2017 10:45:09 +0100 Subject: [PATCH 1/2] correct PHP code --- form/unit_testing.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/form/unit_testing.rst b/form/unit_testing.rst index 639e5936f1d..3391984c98c 100644 --- a/form/unit_testing.rst +++ b/form/unit_testing.rst @@ -191,7 +191,7 @@ allows you to return a list of extensions to register:: $this->validator ->method('validate') ->will($this->returnValue(new ConstraintViolationList())); - $validator + $this->validator ->method('getMetadataFor') ->will($this->returnValue(new ClassMetadata(Form::class))); @@ -227,14 +227,15 @@ a good opportunity to use them:: class TestedTypeTest extends TypeTestCase { - /** - * @dataProvider getValidTestData - */ + public function testForm($data) { // ... your test } - + + /** + * @dataProvider getValidTestData + */ public function getValidTestData() { return array( From 3039ea3675377efeeeb773790c5dee8604c95b5b Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 13 Jun 2017 10:45:22 +0200 Subject: [PATCH 2/2] [#8013] revert wrong data provider change --- form/unit_testing.rst | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/form/unit_testing.rst b/form/unit_testing.rst index 3391984c98c..6ee3ffe0946 100644 --- a/form/unit_testing.rst +++ b/form/unit_testing.rst @@ -191,7 +191,7 @@ allows you to return a list of extensions to register:: $this->validator ->method('validate') ->will($this->returnValue(new ConstraintViolationList())); - $this->validator + $this->validator ->method('getMetadataFor') ->will($this->returnValue(new ClassMetadata(Form::class))); @@ -227,15 +227,14 @@ a good opportunity to use them:: class TestedTypeTest extends TypeTestCase { - + /** + * @dataProvider getValidTestData + */ public function testForm($data) { // ... your test } - - /** - * @dataProvider getValidTestData - */ + public function getValidTestData() { return array(