ConstraintValidatorTestCase and PHPUnit 10 #49218
Labels
Bug
Help wanted
Issues and PRs which are looking for volunteers to complete them.
Status: Reviewed
Validator
Symfony version(s) affected
all
Description
When validating custom Constraints
Symfony\Component\Validator\Test\ConstraintValidatorTestCase
is used.During setup ConstraintValidatorTestCase is setting context by calling
MockBuilder::setMethods()
that was removed in PHPUnit 10 (see sebastianbergmann/phpunit#3769 ).How to reproduce
Install PHPUnit 10 and write a custom validator test as explained in the documentation.
Possible Solution
Check version of PHPUnit being used and replace a call to
MockBuilder::setMethods()
withMockBuilder::onlyMethods()
if PHPUnit >= 10.0 is detected.Additional Context
No response
The text was updated successfully, but these errors were encountered: