Skip to content

ConstraintValidatorTestCase and PHPUnit 10 #49218

Closed
@gjuric

Description

@gjuric

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() with MockBuilder::onlyMethods() if PHPUnit >= 10.0 is detected.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions