update v1.0.7.9 R.C.

This is a Release Candidate. We are still testing.
This commit is contained in:
Sujit Prasad
2016-08-03 20:04:36 +05:30
parent 8b6b924d09
commit ffa56a43cb
3830 changed files with 181529 additions and 495353 deletions

View File

@@ -693,6 +693,25 @@ EOT;
$this->assertSame($expected, $this->parser->parse($yaml));
}
public function testSequenceFollowedByCommentEmbeddedInMapping()
{
$yaml = <<<EOT
a:
b:
- c
# comment
d: e
EOT;
$expected = array(
'a' => array(
'b' => array('c'),
'd' => 'e',
),
);
$this->assertSame($expected, $this->parser->parse($yaml));
}
/**
* @expectedException \Symfony\Component\Yaml\Exception\ParseException
*/
@@ -1243,6 +1262,74 @@ EOT;
$this->assertEquals(array('date' => $expectedDate), $this->parser->parse($yaml, Yaml::PARSE_DATETIME));
}
/**
* @param $lineNumber
* @param $yaml
* @dataProvider parserThrowsExceptionWithCorrectLineNumberProvider
*/
public function testParserThrowsExceptionWithCorrectLineNumber($lineNumber, $yaml)
{
$this->setExpectedException(
'\Symfony\Component\Yaml\Exception\ParseException',
sprintf('Unexpected characters near "," at line %d (near "bar: "123",").', $lineNumber)
);
$this->parser->parse($yaml);
}
public function parserThrowsExceptionWithCorrectLineNumberProvider()
{
return array(
array(
4,
<<<YAML
foo:
-
# bar
bar: "123",
YAML
),
array(
5,
<<<YAML
foo:
-
# bar
# bar
bar: "123",
YAML
),
array(
8,
<<<YAML
foo:
-
# foobar
baz: 123
bar:
-
# bar
bar: "123",
YAML
),
array(
10,
<<<YAML
foo:
-
# foobar
# foobar
baz: 123
bar:
-
# bar
# bar
bar: "123",
YAML
),
);
}
}
class B