[Form] added a unit test

This commit is contained in:
Fabien Potencier 2011-04-18 19:01:09 +02:00
parent d93e10160c
commit 33498bffa4

View File

@ -91,6 +91,19 @@ class DelegatingValidatorTest extends \PHPUnit_Framework_TestCase
return $this->getMock('Symfony\Tests\Component\Form\FormInterface');
}
public function testUseValidateValueWhenValidationConstraintExist()
{
$constraint = $this->getMockForAbstractClass('Symfony\Component\Validator\Constraint');
$form = $this
->getBuilder('name')
->setAttribute('validation_constraint', $constraint)
->getForm();
$this->delegate->expects($this->once())->method('validateValue');
$this->validator->validate($form);
}
public function testFormErrorsOnForm()
{
$form = $this->getForm();