[Form] Fix error message in circular reference dependencies check

This commit is contained in:
Pierre du Plessis 2017-10-10 13:00:46 +02:00 committed by Christophe Coevoet
parent d3bc436cd2
commit 48eb43daed
2 changed files with 3 additions and 3 deletions

View File

@ -111,7 +111,7 @@ class FormRegistry implements FormRegistryInterface
if (isset($this->checkedTypes[$fqcn])) { if (isset($this->checkedTypes[$fqcn])) {
$types = implode(' > ', array_merge(array_keys($this->checkedTypes), array($fqcn))); $types = implode(' > ', array_merge(array_keys($this->checkedTypes), array($fqcn)));
throw new LogicException(sprintf('Circular reference detected for form "%s" (%s).', $fqcn, $types)); throw new LogicException(sprintf('Circular reference detected for form type "%s" (%s).', $fqcn, $types));
} }
$this->checkedTypes[$fqcn] = true; $this->checkedTypes[$fqcn] = true;

View File

@ -162,7 +162,7 @@ class FormRegistryTest extends TestCase
/** /**
* @expectedException \Symfony\Component\Form\Exception\LogicException * @expectedException \Symfony\Component\Form\Exception\LogicException
* @expectedExceptionMessage Circular reference detected for form "Symfony\Component\Form\Tests\Fixtures\FormWithSameParentType" (Symfony\Component\Form\Tests\Fixtures\FormWithSameParentType > Symfony\Component\Form\Tests\Fixtures\FormWithSameParentType). * @expectedExceptionMessage Circular reference detected for form type "Symfony\Component\Form\Tests\Fixtures\FormWithSameParentType" (Symfony\Component\Form\Tests\Fixtures\FormWithSameParentType > Symfony\Component\Form\Tests\Fixtures\FormWithSameParentType).
*/ */
public function testFormCannotHaveItselfAsAParent() public function testFormCannotHaveItselfAsAParent()
{ {
@ -175,7 +175,7 @@ class FormRegistryTest extends TestCase
/** /**
* @expectedException \Symfony\Component\Form\Exception\LogicException * @expectedException \Symfony\Component\Form\Exception\LogicException
* @expectedExceptionMessage Circular reference detected for form "Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeFoo" (Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeFoo > Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeBar > Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeBaz > Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeFoo). * @expectedExceptionMessage Circular reference detected for form type "Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeFoo" (Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeFoo > Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeBar > Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeBaz > Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeFoo).
*/ */
public function testRecursiveFormDependencies() public function testRecursiveFormDependencies()
{ {