@@ -38,7 +38,7 @@ public function testSetProperties()
38
38
39
39
public function testSetNotExistingPropertyThrowsException ()
40
40
{
41
- $ this ->expectException (' Symfony\Component\Validator\Exception\ InvalidOptionsException' );
41
+ $ this ->expectException (InvalidOptionsException::class );
42
42
43
43
new ConstraintA ([
44
44
'foo ' => 'bar ' ,
@@ -49,14 +49,14 @@ public function testMagicPropertiesAreNotAllowed()
49
49
{
50
50
$ constraint = new ConstraintA ();
51
51
52
- $ this ->expectException (' Symfony\Component\Validator\Exception\ InvalidOptionsException' );
52
+ $ this ->expectException (InvalidOptionsException::class );
53
53
54
54
$ constraint ->foo = 'bar ' ;
55
55
}
56
56
57
57
public function testInvalidAndRequiredOptionsPassed ()
58
58
{
59
- $ this ->expectException (' Symfony\Component\Validator\Exception\ InvalidOptionsException' );
59
+ $ this ->expectException (InvalidOptionsException::class );
60
60
61
61
new ConstraintC ([
62
62
'option1 ' => 'default ' ,
@@ -104,14 +104,14 @@ public function testDontSetDefaultPropertyIfValuePropertyExists()
104
104
105
105
public function testSetUndefinedDefaultProperty ()
106
106
{
107
- $ this ->expectException (' Symfony\Component\Validator\Exception\ConstraintDefinitionException ' );
107
+ $ this ->expectException (\ Symfony \Component \Validator \Exception \ConstraintDefinitionException::class );
108
108
109
109
new ConstraintB ('foo ' );
110
110
}
111
111
112
112
public function testRequiredOptionsMustBeDefined ()
113
113
{
114
- $ this ->expectException (' Symfony\Component\Validator\Exception\MissingOptionsException ' );
114
+ $ this ->expectException (\ Symfony \Component \Validator \Exception \MissingOptionsException::class );
115
115
116
116
new ConstraintC ();
117
117
}
@@ -209,7 +209,7 @@ public function testSerializeKeepsCustomGroups()
209
209
210
210
public function testGetErrorNameForUnknownCode ()
211
211
{
212
- $ this ->expectException (' Symfony\Component\Validator\Exception\InvalidArgumentException ' );
212
+ $ this ->expectException (\ Symfony \Component \Validator \Exception \InvalidArgumentException::class );
213
213
Constraint::getErrorName (1 );
214
214
}
215
215
@@ -226,7 +226,7 @@ public function testOptionsAsDefaultOption()
226
226
227
227
public function testInvalidOptions ()
228
228
{
229
- $ this ->expectException (' Symfony\Component\Validator\Exception\ InvalidOptionsException' );
229
+ $ this ->expectException (InvalidOptionsException::class );
230
230
$ this ->expectExceptionMessage ('The options "0", "5" do not exist in constraint "Symfony\Component\Validator\Tests\Fixtures\ConstraintA". ' );
231
231
new ConstraintA (['property2 ' => 'foo ' , 'bar ' , 5 => 'baz ' ]);
232
232
}
@@ -244,7 +244,7 @@ public function testOptionsWithInvalidInternalPointer()
244
244
245
245
public function testAnnotationSetUndefinedDefaultOption ()
246
246
{
247
- $ this ->expectException (' Symfony\Component\Validator\Exception\ConstraintDefinitionException ' );
247
+ $ this ->expectException (\ Symfony \Component \Validator \Exception \ConstraintDefinitionException::class );
248
248
$ this ->expectExceptionMessage ('No default option is configured for constraint "Symfony\Component\Validator\Tests\Fixtures\ConstraintB". ' );
249
249
new ConstraintB (['value ' => 1 ]);
250
250
}
0 commit comments