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] Define which collection keys should be checked for uniqueness #42403

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

Closed
wants to merge 12 commits into from
Prev Previous commit
Next Next commit
Add test for optional collection fields
  • Loading branch information
wkania committed Apr 3, 2022
commit fa4f627208d6d37af46cff3924c562c37cd0b10a
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

class UniqueValidatorTest extends ConstraintValidatorTestCase
{
protected function createValidator()
protected function createValidator(): UniqueValidator
{
return new UniqueValidator();
}
Expand Down Expand Up @@ -221,6 +221,13 @@ public function testExpectsValidCaseInsensitiveComparison()
$this->assertNoViolation();
}

public function testCollectionFieldsAreOptional()
{
$this->validator->validate([['value' => 5], ['id' => 1, 'value' => 6]], new Unique('id'));

$this->assertNoViolation();
}

/**
* @dataProvider getInvalidCollectionValues
*/
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.