mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Fixed detection of missing comma and added detection of missing colon in json
This commit is contained in:
parent
b9f0e89e7b
commit
76a2be5ae0
2 changed files with 22 additions and 1 deletions
|
@ -84,6 +84,25 @@ class JsonFileTest extends \PHPUnit_Framework_TestCase
|
|||
$this->expectParseException('missing comma on line 2, char 21', $json);
|
||||
}
|
||||
|
||||
public function testParseErrorDetectMissingCommaMultiline()
|
||||
{
|
||||
$json = '{
|
||||
"foo": "barbar"
|
||||
|
||||
"bar": "foo"
|
||||
}';
|
||||
$this->expectParseException('missing comma on line 2, char 24', $json);
|
||||
}
|
||||
|
||||
public function testParseErrorDetectMissingColon()
|
||||
{
|
||||
$json = '{
|
||||
"foo": "bar",
|
||||
"bar" "foo"
|
||||
}';
|
||||
$this->expectParseException('missing colon on line 3, char 14', $json);
|
||||
}
|
||||
|
||||
public function testSimpleJsonString()
|
||||
{
|
||||
$data = array('name' => 'composer/composer');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue