Skip to content

Commit c193035

Browse files
authored
added missing ClassMetadata
1 parent 9671b95 commit c193035

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

form/unit_testing.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ allows you to return a list of extensions to register::
178178
use Symfony\Component\Form\FormBuilder;
179179
use Symfony\Component\Form\Test\TypeTestCase;
180180
use Symfony\Component\Validator\ConstraintViolationList;
181+
use Symfony\Component\Validator\Mapping\ClassMetadata;
181182
use Symfony\Component\Validator\Validator\ValidatorInterface;
182183

183184
class TestedTypeTest extends TypeTestCase
@@ -190,6 +191,9 @@ allows you to return a list of extensions to register::
190191
$validator
191192
->method('validate')
192193
->will($this->returnValue(new ConstraintViolationList()));
194+
$validator
195+
->method('getMetadataFor')
196+
->will($this->returnValue(new ClassMetadata('Symfony\Component\Form\Form')));
193197

194198
return array(
195199
new ValidatorExtension($validator),

0 commit comments

Comments
 (0)