[Form] Fix getValidator() to reference the "validator" option instead of property
This commit is contained in:
parent
209dcfefce
commit
4e0db56810
@ -662,7 +662,7 @@ class Form extends Field implements \IteratorAggregate, FormInterface
|
||||
*/
|
||||
public function getValidator()
|
||||
{
|
||||
return $this->validator;
|
||||
return $this->getOption('validator');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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());
|
||||
|
Reference in New Issue
Block a user