minor #27338 [Form] fix tests on old phpunit versions (nicolas-grekas)

This PR was merged into the 3.4 branch.

Discussion
----------

[Form] fix tests on old phpunit versions

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Should make appveyor green.

Commits
-------

208d1d1306 [Form] fix tests on old phpunit versions
This commit is contained in:
Nicolas Grekas 2018-05-22 14:58:23 +02:00
commit 614ffde9e5
3 changed files with 3 additions and 2 deletions

View File

@ -31,7 +31,7 @@ trait ValidatorExtensionTrait
}
$this->validator = $this->getMockBuilder(ValidatorInterface::class)->getMock();
$metadata = $this->getMockBuilder(ClassMetadata::class)->disableOriginalConstructor()->getMock();
$metadata = $this->getMockBuilder(ClassMetadata::class)->disableOriginalConstructor()->setMethods(array('addPropertyConstraint'))->getMock();
$this->validator->expects($this->any())->method('getMetadataFor')->will($this->returnValue($metadata));
$this->validator->expects($this->any())->method('validate')->will($this->returnValue(array()));

View File

@ -22,6 +22,7 @@ class ValidatorExtensionTest extends TestCase
->disableOriginalConstructor()
->getMock();
$metadata = $this->getMockBuilder('Symfony\Component\Validator\Mapping\ClassMetadata')
->setMethods(array('addConstraint', 'addPropertyConstraint'))
->disableOriginalConstructor()
->getMock();

View File

@ -60,5 +60,5 @@ interface AttributeMetadataInterface
/**
* Merges an {@see AttributeMetadataInterface} with in the current one.
*/
public function merge(self $attributeMetadata);
public function merge(AttributeMetadataInterface $attributeMetadata);
}