Skip to content

Commit 8797be8

Browse files
committed
bug symfony#58316 [Form] Don't call the constructor of LogicalOr (derrabus)
This PR was merged into the 5.4 branch. Discussion ---------- [Form] Don't call the constructor of LogicalOr | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | N/A | License | MIT This PR fixes an incompatibility of our `ConstraintValidatorTestCase` with PHPUnit 11. In PHPUnit 11, the constructors of `LogicalOr` and friends are protected. The static constructor `fromConstraints()` is the proper replacement and has existed since PHPUnit 6. Commits ------- b5fc170 Don't call the constructor of LogicalOr
2 parents 60a39d6 + b5fc170 commit 8797be8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Symfony/Component/Validator/Test/ConstraintValidatorTestCase.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,7 @@ protected function expectValidateAt(int $i, string $propertyPath, $value, $group
234234
{
235235
$validator = $this->context->getValidator()->inContext($this->context);
236236
$validator->expectValidation($i, $propertyPath, $value, $group, function ($passedConstraints) {
237-
$expectedConstraints = new LogicalOr();
238-
$expectedConstraints->setConstraints([new IsNull(), new IsIdentical([]), new IsInstanceOf(Valid::class)]);
237+
$expectedConstraints = LogicalOr::fromConstraints(new IsNull(), new IsIdentical([]), new IsInstanceOf(Valid::class));
239238

240239
Assert::assertThat($passedConstraints, $expectedConstraints);
241240
});

0 commit comments

Comments
 (0)