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] Validate all groups when special group name * is specified in validate() method #50679

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

Open
wants to merge 5 commits into
base: 7.4
Choose a base branch
Loading
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add default group to test case
  • Loading branch information
dwgebler committed Jun 15, 2023
commit e0aa29be003104e88216443e7609f242518030ac
2 changes: 2 additions & 0 deletions 2 src/Symfony/Component/Validator/Mapping/GenericMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,10 @@ public function findConstraints(string $group): array
foreach ($this->constraintsByGroup as $groupConstraints) {
$constraints = array_merge($constraints, $groupConstraints);
}

return $constraints;
}

return $this->constraintsByGroup[$group] ?? [];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1130,11 +1130,14 @@ public function testValidateAllGroups()
'callback' => $callback,
'groups' => 'Group 2',
]));
$this->metadata->addConstraint(new Callback([
'callback' => $callback,
]));

$violations = $this->validate($entity, null, '*');

/* @var ConstraintViolationInterface[] $violations */
$this->assertCount(2, $violations);
$this->assertCount(3, $violations);
}

public function testReplaceDefaultGroupByGroupSequenceObject()
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.