From 33498bffa4a1a23353585f6e3a3a83cc4fbbbfe8 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 18 Apr 2011 19:01:09 +0200 Subject: [PATCH] [Form] added a unit test --- .../Form/Validator/DelegatingValidatorTest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/Symfony/Tests/Component/Form/Validator/DelegatingValidatorTest.php b/tests/Symfony/Tests/Component/Form/Validator/DelegatingValidatorTest.php index 05d56ed060..56381ecd6e 100644 --- a/tests/Symfony/Tests/Component/Form/Validator/DelegatingValidatorTest.php +++ b/tests/Symfony/Tests/Component/Form/Validator/DelegatingValidatorTest.php @@ -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();