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