From c193035c3e9c1e9e2097babeccfd6fbafa7c7d87 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Tue, 23 May 2017 12:05:44 +0200 Subject: [PATCH] added missing ClassMetadata --- form/unit_testing.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/form/unit_testing.rst b/form/unit_testing.rst index a1e4b6eb1a8..584df43f77c 100644 --- a/form/unit_testing.rst +++ b/form/unit_testing.rst @@ -178,6 +178,7 @@ allows you to return a list of extensions to register:: use Symfony\Component\Form\FormBuilder; use Symfony\Component\Form\Test\TypeTestCase; use Symfony\Component\Validator\ConstraintViolationList; + use Symfony\Component\Validator\Mapping\ClassMetadata; use Symfony\Component\Validator\Validator\ValidatorInterface; class TestedTypeTest extends TypeTestCase @@ -190,6 +191,9 @@ allows you to return a list of extensions to register:: $validator ->method('validate') ->will($this->returnValue(new ConstraintViolationList())); + $validator + ->method('getMetadataFor') + ->will($this->returnValue(new ClassMetadata('Symfony\Component\Form\Form'))); return array( new ValidatorExtension($validator),