Skip to content

Commit 0d92f86

Browse files
committed
minor symfony#59895 [Validator] fix test setup and skip test until bug is fixed in PHP (xabbuh)
This PR was merged into the 7.3 branch. Discussion ---------- [Validator] fix test setup and skip test until bug is fixed in PHP | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT Commits ------- 56bd932 fix test setup and skip test until bug is fixed in PHP
2 parents 656dc29 + 56bd932 commit 0d92f86

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/Symfony/Component/Validator/Tests/Constraints/Fixtures/WhenTestWithClosure.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111

1212
namespace Symfony\Component\Validator\Tests\Constraints\Fixtures;
1313

14+
use Symfony\Component\Validator\Constraints\Callback;
1415
use Symfony\Component\Validator\Constraints\NotBlank;
1516
use Symfony\Component\Validator\Constraints\NotNull;
1617
use Symfony\Component\Validator\Constraints\When;
1718

1819
#[When(expression: static function () {
1920
return true;
20-
}, constraints: new NotNull()
21+
}, constraints: new Callback('isValid')
2122
)]
2223
class WhenTestWithClosure
2324
{

src/Symfony/Component/Validator/Tests/Constraints/WhenTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ public function testAttributes()
118118
*/
119119
public function testAttributesWithClosure()
120120
{
121+
$this->markTestSkipped('Requires https://github.com/php/php-src/issues/17851 to be fixed');
122+
121123
$loader = new AttributeLoader();
122124
$metadata = new ClassMetadata(WhenTestWithClosure::class);
123125

@@ -129,7 +131,7 @@ public function testAttributesWithClosure()
129131
self::assertInstanceOf(\Closure::class, $classConstraint->expression);
130132
self::assertEquals([
131133
new Callback(
132-
callback: 'callback',
134+
callback: 'isValid',
133135
groups: ['Default', 'WhenTestWithClosure'],
134136
),
135137
], $classConstraint->constraints);

0 commit comments

Comments
 (0)