8000 minor #7941 added missing ClassMetadata (OskarStark) · symfony/symfony-docs@ab67584 · GitHub
[go: up one dir, main page]

Skip to content

Commit ab67584

Browse files
committed
minor #7941 added missing ClassMetadata (OskarStark)
This PR was merged into the 2.7 branch. Discussion ---------- added missing ClassMetadata This needs to be merged into the following branches too Closes #7270 Refs symfony/symfony#20952 Commits ------- c193035 added missing Cl 8000 assMetadata
2 parents 984dce8 + c193035 commit ab67584

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)
0