Skip to content

Commit

Permalink
Merge branch '5.1' into 5.2
Browse files Browse the repository at this point in the history
* 5.1:
  Use import instead of FQCN
  • Loading branch information
nicolas-grekas committed Jan 27, 2021
2 parents d4bf2ca + c651438 commit c2c234d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Tests/Constraints/AtLeastOneOfTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use PHPUnit\Framework\TestCase;
use Symfony\Component\Validator\Constraints\AtLeastOneOf;
use Symfony\Component\Validator\Constraints\Valid;
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;

/**
* @author Przemysław Bogusz <[email protected]>
Expand All @@ -22,15 +23,15 @@ class AtLeastOneOfTest extends TestCase
{
public function testRejectNonConstraints()
{
$this->expectException(\Symfony\Component\Validator\Exception\ConstraintDefinitionException::class);
$this->expectException(ConstraintDefinitionException::class);
new AtLeastOneOf([
'foo',
]);
}

public function testRejectValidConstraint()
{
$this->expectException(\Symfony\Component\Validator\Exception\ConstraintDefinitionException::class);
$this->expectException(ConstraintDefinitionException::class);
new AtLeastOneOf([
new Valid(),
]);
Expand Down
3 changes: 2 additions & 1 deletion Tests/Constraints/HostnameValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Symfony\Component\Validator\Constraints\Hostname;
use Symfony\Component\Validator\Constraints\HostnameValidator;
use Symfony\Component\Validator\Exception\UnexpectedValueException;
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;

/**
Expand All @@ -36,7 +37,7 @@ public function testEmptyStringIsValid()

public function testExpectsStringCompatibleType()
{
$this->expectException(\Symfony\Component\Validator\Exception\UnexpectedValueException::class);
$this->expectException(UnexpectedValueException::class);

$this->validator->validate(new \stdClass(), new Hostname());
}
Expand Down

0 comments on commit c2c234d

Please sign in to comment.