[Form] Fix getValidator() to reference the "validator" option instead of property

This commit is contained in:
Jeremy Mikola 2011-02-01 12:07:59 -05:00 committed by Fabien Potencier
parent 209dcfefce
commit 4e0db56810
2 changed files with 6 additions and 1 deletions

View File

@ -662,7 +662,7 @@ class Form extends Field implements \IteratorAggregate, FormInterface
*/
public function getValidator()
{
return $this->validator;
return $this->getOption('validator');
}
/**

View File

@ -169,6 +169,11 @@ class FormTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($form->isCsrfTokenValid());
}
public function testGetValidator()
{
$this->assertSame($this->validator, $this->form->getValidator());
}
public function testValidationGroupNullByDefault()
{
$this->assertNull($this->form->getValidationGroups());