Skip to content

Commit

Permalink
[Form] Fix getValidator() to reference the "validator" option instead…
Browse files Browse the repository at this point in the history
… of property
  • Loading branch information
jmikola authored and fabpot committed Feb 2, 2011
1 parent 209dcfe commit 4e0db56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Form/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ public function getFieldFactory()
*/
public function getValidator()
{
return $this->validator;
return $this->getOption('validator');
}

/**
Expand Down
5 changes: 5 additions & 0 deletions tests/Symfony/Tests/Component/Form/FormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ public function testIsCsrfTokenValidFails()
$this->assertFalse($form->isCsrfTokenValid());
}

public function testGetValidator()
{
$this->assertSame($this->validator, $this->form->getValidator());
}

public function testValidationGroupNullByDefault()
{
$this->assertNull($this->form->getValidationGroups());
Expand Down

0 comments on commit 4e0db56

Please sign in to comment.