From 81bd6de18685a373678a25b6ba98b3cc45a5d336 Mon Sep 17 00:00:00 2001 From: Jules Pietri Date: Sat, 6 Apr 2019 15:39:08 +0200 Subject: [PATCH] added a test case --- .../Component/Form/Tests/SimpleFormTest.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Symfony/Component/Form/Tests/SimpleFormTest.php b/src/Symfony/Component/Form/Tests/SimpleFormTest.php index 8cd81858981af..86eef4ce8d10c 100644 --- a/src/Symfony/Component/Form/Tests/SimpleFormTest.php +++ b/src/Symfony/Component/Form/Tests/SimpleFormTest.php @@ -54,6 +54,25 @@ public function getIterator() class SimpleFormTest extends AbstractFormTest { + /** + * @dataProvider provideFormNames + */ + public function testGetPropertyPath($name, $propertyPath) + { + $config = new FormConfigBuilder($name, null, $this->dispatcher); + $form = new Form($config); + + $this->assertEquals(new PropertyPath($propertyPath), $form->getPropertyPath()); + } + + public function provideFormNames() + { + yield [null, null]; + yield ['', null]; + yield ['0', '0']; + yield [0, '0']; + yield ['name', 'name']; + } public function testDataIsInitializedToConfiguredValue() { $model = new FixedDataTransformer([