$this->expectParseException('use double quotes (") instead of single quotes (\') on line 2, char 9',$json);
}
publicfunctiontestParseErrorDetectMissingQuotes()
{
$json='{
foo:"bar"
}';
$this->expectParseException('must use double quotes (") around keys on line 2, char 9',$json);
}
publicfunctiontestParseErrorDetectArrayAsHash()
{
$json='{
"foo":["bar":"baz"]
}';
$this->expectParseException('you must use the hash syntax (e.g. {"foo": "bar"}) instead of array syntax (e.g. ["foo", "bar"]) on line 2, char 16',$json);
}
publicfunctiontestParseErrorDetectMissingComma()
{
$json='{
"foo":"bar"
"bar":"foo"
}';
$this->expectParseException('missing comma on line 2, char 21',$json);