Skip to content

Commit 8797be8

Browse files
committed
bug #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

Lines changed: 1 addition & 2 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy