|
13 | 13 |
|
14 | 14 | use PHPUnit\Framework\TestCase;
|
15 | 15 | use Symfony\Component\Validator\Constraint;
|
| 16 | +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; |
| 17 | +use Symfony\Component\Validator\Exception\InvalidArgumentException; |
16 | 18 | use Symfony\Component\Validator\Exception\InvalidOptionsException;
|
| 19 | +use Symfony\Component\Validator\Exception\MissingOptionsException; |
17 | 20 | use Symfony\Component\Validator\Tests\Fixtures\ClassConstraint;
|
18 | 21 | use Symfony\Component\Validator\Tests\Fixtures\ConstraintA;
|
19 | 22 | use Symfony\Component\Validator\Tests\Fixtures\ConstraintB;
|
@@ -104,14 +107,14 @@ public function testDontSetDefaultPropertyIfValuePropertyExists()
|
104 | 107 |
|
105 | 108 | public function testSetUndefinedDefaultProperty()
|
106 | 109 | {
|
107 |
| - $this->expectException(\Symfony\Component\Validator\Exception\ConstraintDefinitionException::class); |
| 110 | + $this->expectException(ConstraintDefinitionException::class); |
108 | 111 |
|
109 | 112 | new ConstraintB('foo');
|
110 | 113 | }
|
111 | 114 |
|
112 | 115 | public function testRequiredOptionsMustBeDefined()
|
113 | 116 | {
|
114 |
| - $this->expectException(\Symfony\Component\Validator\Exception\MissingOptionsException::class); |
| 117 | + $this->expectException(MissingOptionsException::class); |
115 | 118 |
|
116 | 119 | new ConstraintC();
|
117 | 120 | }
|
@@ -209,7 +212,7 @@ public function testSerializeKeepsCustomGroups()
|
209 | 212 |
|
210 | 213 | public function testGetErrorNameForUnknownCode()
|
211 | 214 | {
|
212 |
| - $this->expectException(\Symfony\Component\Validator\Exception\InvalidArgumentException::class); |
| 215 | + $this->expectException(InvalidArgumentException::class); |
213 | 216 | Constraint::getErrorName(1);
|
214 | 217 | }
|
215 | 218 |
|
@@ -244,7 +247,7 @@ public function testOptionsWithInvalidInternalPointer()
|
244 | 247 |
|
245 | 248 | public function testAnnotationSetUndefinedDefaultOption()
|
246 | 249 | {
|
247 |
| - $this->expectException(\Symfony\Component\Validator\Exception\ConstraintDefinitionException::class); |
| 250 | + $this->expectException(ConstraintDefinitionException::class); |
248 | 251 | $this->expectExceptionMessage('No default option is configured for constraint "Symfony\Component\Validator\Tests\Fixtures\ConstraintB".');
|
249 | 252 | new ConstraintB(['value' => 1]);
|
250 | 253 | }
|
|
0 commit comments