소스 검색

[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)

Fabien Potencier 14 년 전
부모
커밋
5182a0c2c4
2개의 변경된 파일1개의 추가작업 그리고 8개의 파일을 삭제
  1. 1 1
      src/Symfony/Component/Form/Util/PropertyPath.php
  2. 0 7
      tests/Symfony/Tests/Component/Form/PropertyPathTest.php

+ 1 - 1
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');
         }
 

+ 0 - 7
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');