You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/JsonParserTest.php
+18-9Lines changed: 18 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,7 @@ public function testErrorOnTrailingComma()
69
69
}');
70
70
$this->fail('Invalid trailing comma should be detected');
71
71
} catch (ParsingException$e) {
72
-
$this->assertContains('It appears you have an extra trailing comma', $e->getMessage());
72
+
$this->assertStringContainsStringCompat('It appears you have an extra trailing comma', $e->getMessage());
73
73
}
74
74
}
75
75
@@ -82,7 +82,7 @@ public function testErrorOnInvalidQuotes()
82
82
}');
83
83
$this->fail('Invalid quotes for string should be detected');
84
84
} catch (ParsingException$e) {
85
-
$this->assertContains('Invalid string, it appears you used single quotes instead of double quotes', $e->getMessage());
85
+
$this->assertStringContainsStringCompat('Invalid string, it appears you used single quotes instead of double quotes', $e->getMessage());
86
86
}
87
87
}
88
88
@@ -95,7 +95,7 @@ public function testErrorOnUnescapedBackslash()
95
95
}');
96
96
$this->fail('Invalid unescaped string should be detected');
97
97
} catch (ParsingException$e) {
98
-
$this->assertContains('Invalid string, it appears you have an unescaped backslash at: \z', $e->getMessage());
98
+
$this->assertStringContainsStringCompat('Invalid string, it appears you have an unescaped backslash at: \z', $e->getMessage());
99
99
}
100
100
}
101
101
@@ -144,7 +144,7 @@ public function testErrorOnUnterminatedString()
144
144
$parser->parse('{"bar": "foo}');
145
145
$this->fail('Invalid unterminated string should be detected');
146
146
} catch (ParsingException$e) {
147
-
$this->assertContains('Invalid string, it appears you forgot to terminate a string, or attempted to write a multiline string which is invalid', $e->getMessage());
147
+
$this->assertStringContainsStringCompat('Invalid string, it appears you forgot to terminate a string, or attempted to write a multiline string which is invalid', $e->getMessage());
148
148
}
149
149
}
150
150
@@ -156,7 +156,7 @@ public function testErrorOnMultilineString()
156
156
bar"}');
157
157
$this->fail('Invalid multi-line string should be detected');
158
158
} catch (ParsingException$e) {
159
-
$this->assertContains('Invalid string, it appears you forgot to terminate a string, or attempted to write a multiline string which is invalid', $e->getMessage());
159
+
$this->assertStringContainsStringCompat('Invalid string, it appears you forgot to terminate a string, or attempted to write a multiline string which is invalid', $e->getMessage());
160
160
}
161
161
}
162
162
@@ -169,7 +169,7 @@ public function testErrorAtBeginning()
169
169
');
170
170
$this->fail('Empty string should be invalid');
171
171
} catch (ParsingException$e) {
172
-
$this->assertContains("Parse error on line 1:\n\n^", $e->getMessage());
172
+
$this->assertStringContainsStringCompat("Parse error on line 1:\n\n^", $e->getMessage());
173
173
}
174
174
}
175
175
@@ -189,7 +189,7 @@ public function testDetectsKeyOverrides()
0 commit comments