8000 minor #21886 [Form] Add validate method to mockec validator in form T… · symfony/symfony@24f3135 · GitHub
[go: up one dir, main page]

Skip to content

Commit 24f3135

Browse files
minor #21886 [Form] Add validate method to mockec validator in form TypeTestCase (pierredup)
This PR was merged into the 2.7 branch. Discussion ---------- [Form] Add validate method to mockec validator in form TypeTestCase | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | N/A | License | MIT | Doc PR | N/A When using the `Symfony\Component\Form\Tests\Extension\Validator\Type\TypeTestCase` class to unit test forms, the `validate` method is not mocked, which causes errors when the unit tests run. Commits ------- 4013e7b Add validate method to mockec validator in form TypeTestCase
2 parents 7311ef3 + 4013e7b commit 24f3135

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Symfony/Component/Form/Tests/Extension/Validator/Type/TypeTestCase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ protected function setUp()
2323
$this->validator = $this->getMockBuilder('Symfony\Component\Validator\Validator\ValidatorInterface')->getMock();
2424
$metadata = $this->getMockBuilder('Symfony\Component\Validator\Mapping\ClassMetadata')->disableOriginalConstructor()->getMock();
2525
$this->validator->expects($this->once())->method('getMetadataFor')->will($this->returnValue($metadata));
26+
$this->validator->expects($this->any())->method('validate')->will($this->returnValue(array()));
2627

2728
parent::setUp();
2829
}

0 commit comments

Comments
 (0)
0