Skip to content

Commit

Permalink
Merge branch '5.4' into 6.2
Browse files Browse the repository at this point in the history
* 5.4:
  CS fix
  Fix test provider
  • Loading branch information
nicolas-grekas committed Feb 16, 2023
2 parents e34c975 + 535d93f commit 8d7daad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Tests/Constraints/RangeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function testThrowsConstraintExceptionIfBothMinLimitAndPropertyPathNamed(
{
$this->expectException(\Symfony\Component\Validator\Exception\ConstraintDefinitionException::class);
$this->expectExceptionMessage('requires only one of the "min" or "minPropertyPath" options to be set, not both.');
eval('new \Symfony\Component\Validator\Constraints\Range(min: "min", minPropertyPath: "minPropertyPath");');
new Range(min: 'min', minPropertyPath: 'minPropertyPath');
}

public function testThrowsConstraintExceptionIfBothMaxLimitAndPropertyPath()
Expand All @@ -49,7 +49,7 @@ public function testThrowsConstraintExceptionIfBothMaxLimitAndPropertyPathNamed(
{
$this->expectException(\Symfony\Component\Validator\Exception\ConstraintDefinitionException::class);
$this->expectExceptionMessage('requires only one of the "max" or "maxPropertyPath" options to be set, not both.');
eval('new \Symfony\Component\Validator\Constraints\Range(max: "max", maxPropertyPath: "maxPropertyPath");');
new Range(max: 'max', maxPropertyPath: 'maxPropertyPath');
}

public function testThrowsConstraintExceptionIfNoLimitNorPropertyPath()
Expand All @@ -69,6 +69,6 @@ public function testThrowsConstraintDefinitionExceptionIfBothMinAndMaxAndMinMess
{
$this->expectException(\Symfony\Component\Validator\Exception\ConstraintDefinitionException::class);
$this->expectExceptionMessage('can not use "minMessage" and "maxMessage" when the "min" and "max" options are both set. Use "notInRangeMessage" instead.');
eval('new \Symfony\Component\Validator\Constraints\Range(min: "min", max: "max", minMessage: "minMessage", maxMessage: "maxMessage");');
new Range(min: 'min', max: 'max', minMessage: 'minMessage', maxMessage: 'maxMessage');
}
}
3 changes: 1 addition & 2 deletions Tests/Constraints/UlidValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Symfony\Component\Validator\Tests\Constraints;

use stdClass;
use Symfony\Component\Validator\Constraints\Ulid;
use Symfony\Component\Validator\Constraints\UlidValidator;
use Symfony\Component\Validator\Exception\UnexpectedValueException;
Expand Down Expand Up @@ -44,7 +43,7 @@ public function testEmptyStringIsValid()
public function testExpectsStringCompatibleType()
{
$this->expectException(UnexpectedValueException::class);
$this->validator->validate(new stdClass(), new Ulid());
$this->validator->validate(new \stdClass(), new Ulid());
}

public function testValidUlid()
Expand Down

0 comments on commit 8d7daad

Please sign in to comment.