Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Validator] fix test setup and skip test until bug is fixed in PHP #59895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@

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

use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\NotNull;
use Symfony\Component\Validator\Constraints\When;

#[When(expression: static function () {
return true;
}, constraints: new NotNull()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Symfony\Component\Validator\Exception\ConstraintDefinitionException: The constraint "Symfony\Component\Validator\Constraints\NotNull" cannot be put on classes.

}, constraints: new Callback('isValid')
)]
class WhenTestWithClosure
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ public function testAttributes()
*/
public function testAttributesWithClosure()
{
$this->markTestSkipped('Requires https://github.com/php/php-src/issues/17851 to be fixed');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexandre-daubois and me are keeping an eye on php/php-src#17851 to revert this change once the bug in PHP has been fixed


$loader = new AttributeLoader();
$metadata = new ClassMetadata(WhenTestWithClosure::class);

Expand All @@ -129,7 +131,7 @@ public function testAttributesWithClosure()
self::assertInstanceOf(\Closure::class, $classConstraint->expression);
self::assertEquals([
new Callback(
callback: 'callback',
callback: 'isValid',
groups: ['Default', 'WhenTestWithClosure'],
),
], $classConstraint->constraints);
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.