From 5182a0c2c417f0e10ecec7d5c6c4f8edba362a5e Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sat, 16 Jul 2011 00:34:50 +0200 Subject: [PATCH] [Form] removed a constraint in PropertyPath as the path can definitely be an empty string for errors attached on the main form (when using a constraint defined with the 'validation_constraint' option) --- src/Symfony/Component/Form/Util/PropertyPath.php | 2 +- tests/Symfony/Tests/Component/Form/PropertyPathTest.php | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Symfony/Component/Form/Util/PropertyPath.php b/src/Symfony/Component/Form/Util/PropertyPath.php index 9f33f9a2aa..756377d0df 100644 --- a/src/Symfony/Component/Form/Util/PropertyPath.php +++ b/src/Symfony/Component/Form/Util/PropertyPath.php @@ -55,7 +55,7 @@ class PropertyPath implements \IteratorAggregate */ public function __construct($propertyPath) { - if ('' === $propertyPath || null === $propertyPath) { + if (null === $propertyPath) { throw new InvalidPropertyPathException('The property path must not be empty'); } diff --git a/tests/Symfony/Tests/Component/Form/PropertyPathTest.php b/tests/Symfony/Tests/Component/Form/PropertyPathTest.php index 74daa2f9b7..178c738b4f 100644 --- a/tests/Symfony/Tests/Component/Form/PropertyPathTest.php +++ b/tests/Symfony/Tests/Component/Form/PropertyPathTest.php @@ -385,13 +385,6 @@ class PropertyPathTest extends \PHPUnit_Framework_TestCase new PropertyPath('property.$form'); } - public function testInvalidPropertyPath_empty() - { - $this->setExpectedException('Symfony\Component\Form\Exception\InvalidPropertyPathException'); - - new PropertyPath(''); - } - public function testInvalidPropertyPath_null() { $this->setExpectedException('Symfony\Component\Form\Exception\InvalidPropertyPathException');