@@ -66,14 +66,14 @@ public function getTestsForParsePhpConstants()
66
66
67
67
public function testParsePhpConstantThrowsExceptionWhenUndefined ()
68
68
{
69
- $ this ->expectException (' Symfony\Component\Yaml\Exception\ ParseException' );
69
+ $ this ->expectException (ParseException::class );
70
70
$ this ->expectExceptionMessage ('The constant "WRONG_CONSTANT" is not defined ' );
71
71
Inline::parse ('!php/const WRONG_CONSTANT ' , Yaml::PARSE_CONSTANT );
72
72
}
73
73
74
74
public function testParsePhpConstantThrowsExceptionOnInvalidType ()
75
75
{
76
- $ this ->expectException (' Symfony\Component\Yaml\Exception\ ParseException' );
76
+ $ this ->expectException (ParseException::class );
77
77
$ this ->expectExceptionMessageMatches ('#The string "!php/const PHP_INT_MAX" could not be parsed as a constant.*# ' );
78
78
Inline::parse ('!php/const PHP_INT_MAX ' , Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE );
79
79
}
@@ -117,60 +117,60 @@ public function testHashStringsResemblingExponentialNumericsShouldNotBeChangedTo
117
117
118
118
public function testParseScalarWithNonEscapedBlackslashShouldThrowException ()
119
119
{
120
- $ this ->expectException (' Symfony\Component\Yaml\Exception\ ParseException' );
120
+ $ this ->expectException (ParseException::class );
121
121
$ this ->expectExceptionMessage ('Found unknown escape character "\V". ' );
122
122
Inline::parse ('"Foo\Var" ' );
123
123
}
124
124
125
125
public function testParseScalarWithNonEscapedBlackslashAtTheEndShouldThrowException ()
126
126
{
127
- $ this ->expectException (' Symfony\Component\Yaml\Exception\ ParseException' );
127
+ $ this ->expectException (ParseException::class );
128
128
Inline::parse ('"Foo \\" ' );
129
129
}
130
130
131
131
public function testParseScalarWithIncorrectlyQuotedStringShouldThrowException ()
132
132
{
133
- $ this ->expectException (' Symfony\Component\Yaml\Exception\ ParseException' );
133
+ $ this ->expectException (ParseException::class );
134
134
$ value = "'don't do somthin' like that' " ;
135
135
Inline::parse ($ value );
136
136
}
137
137
138
138
public function testParseScalarWithIncorrectlyDoubleQuotedStringShouldThrowException ()
139
139
{
140
- $ this ->expectException (' Symfony\Component\Yaml\Exception\ ParseException' );
140
+ $ this ->expectException (ParseException::class );
141
141
$ value = '"don"t do somthin" like that" ' ;
142
142
Inline::parse ($ value );
143
143
}
144
144
145
145
public function testParseInvalidMappingKeyShouldThrowException ()
146
146
{
147
- $ this ->expectException (' Symfony\Component\Yaml\Exception\ ParseException' );
147
+ $ this ->expectException (ParseException::class );
148
148
$ value = '{ "foo " bar": "bar" } ' ;
149
149
Inline::parse ($ value );
150
150
}
151
151
152
152
public function testParseMappingKeyWithColonNotFollowedBySpace ()
153
153
{
154
- $ this ->expectException (' Symfony\Component\Yaml\Exception\ ParseException' );
154
+ $ this ->expectException (ParseException::class );
155
155
$ this ->expectExceptionMessage ('Colons must be followed by a space or an indication character (i.e. " ", ",", "[", "]", "{", "}") ' );
156
156
Inline::parse ('{foo:""} ' );
157
157
}
158
158
159
159
public function testParseInvalidMappingShouldThrowException ()
160
160
{
161
- $ this ->expectException (' Symfony\Component\Yaml\Exception\ ParseException' );
161
+ $ this ->expectException (ParseException::class );
162
162
Inline::parse ('[foo] bar ' );
163
163
}
164
164
165
165
public function testParseInvalidSequenceShouldThrowException ()
166
166
{
167
- $ this ->expectException (' Symfony\Component\Yaml\Exception\ ParseException' );
167
+ $ this ->expectException (ParseException::class );
168
168
Inline::parse ('{ foo: bar } bar ' );
169
169
}
170
170
171
171
public function testParseInvalidTaggedSequenceShouldThrowException ()
172
172
{
173
- $ this ->expectException (' Symfony\Component\Yaml\Exception\ ParseException' );
173
+ $ this ->expectException (ParseException::class );
174
174
Inline::parse ('!foo { bar: baz } qux ' , Yaml::PARSE_CUSTOM_TAGS );
175
175
}
176
176
@@ -216,14 +216,14 @@ public function testParseMapReferenceInSequence()
216
216
217
217
public function testParseUnquotedAsterisk ()
218
218
{
219
- $ this ->expectException (' Symfony\Component\Yaml\Exception\ ParseException' );
219
+ $ this ->expectException (ParseException::class );
220
220
$ this ->expectExceptionMessage ('A reference must contain at least one character at line 1. ' );
221
221
Inline::parse ('{ foo: * } ' );
222
222
}
223
223
224
224
public function testParseUnquotedAsteriskFollowedByAComment ()
225
225
{
226
- $ this ->expectException (' Symfony\Component\Yaml\Exception\ ParseException' );
226
+ $ this ->expectException (ParseException::class );
227
227
$ this ->expectExceptionMessage ('A reference must contain at least one character at line 1. ' );
228
228
Inline::parse ('{ foo: * #foo } ' );
229
229
}
@@ -610,7 +610,7 @@ public function getBinaryData()
610
610
*/
611
611
public function testParseInvalidBinaryData ($ data , $ expectedMessage )
612
612
{
613
- $ this ->expectException (' Symfony\Component\Yaml\Exception\ ParseException' );
613
+ $ this ->expectException (ParseException::class );
614
614
$ this ->expectExceptionMessageMatches ($ expectedMessage );
615
615
616
616
Inline::parse ($ data );
@@ -628,7 +628,7 @@ public function getInvalidBinaryData()
628
628
629
629
public function testNotSupportedMissingValue ()
630
630
{
631
- $ this ->expectException (' Symfony\Component\Yaml\Exception\ ParseException' );
631
+ $ this ->expectException (ParseException::class );
632
632
$ this ->expectExceptionMessage ('Malformed inline YAML string: "{this, is not, supported}" at line 1. ' );
633
633
Inline::parse ('{this, is not, supported} ' );
634
634
}
@@ -645,7 +645,7 @@ public function testVeryLongQuotedStrings()
645
645
646
646
public function testMappingKeysCannotBeOmitted ()
647
647
{
648
- $ this ->expectException (' Symfony\Component\Yaml\Exception\ ParseException' );
648
+ $ this ->expectException (ParseException::class );
649
649
$ this ->expectExceptionMessage ('Missing mapping key ' );
650
650
Inline::parse ('{: foo} ' );
651
651
}
@@ -676,7 +676,7 @@ public function testTheEmptyStringIsAValidMappingKey()
676
676
*/
677
677
public function testImplicitStringCastingOfMappingKeysIsDeprecated ($ yaml , $ expected )
678
678
{
679
- $ this ->expectException (' Symfony\Component\Yaml\Exception\ ParseException' );
679
+ $ this ->expectException (ParseException::class );
680
680
$ this ->expectExceptionMessage ('Implicit casting of incompatible mapping keys to strings is not supported. Quote your evaluable mapping keys instead ' );
681
681
$ this ->assertSame ($ expected , Inline::parse ($ yaml ));
682
682
}
@@ -729,7 +729,7 @@ public function testTagWithEmptyValueInMapping()
729
729
730
730
public function testUnfinishedInlineMap ()
731
731
{
732
- $ this ->expectException (' Symfony\Component\Yaml\Exception\ ParseException' );
732
+ $ this ->expectException (ParseException::class );
733
733
$ this ->expectExceptionMessage ("Unexpected end of line, expected one of \",} \n\" at line 1 (near \"{abc: 'def' \"). " );
734
734
Inline::parse ("{abc: 'def' " );
735
735
}
0 commit comments