Skip to content

Commit

Permalink
[Yaml] Add regression test for comments indents
Browse files Browse the repository at this point in the history
  • Loading branch information
maxime.steinhausser committed Oct 2, 2015
1 parent 510fdea commit 7b9d519
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/Symfony/Component/Yaml/Tests/ParserTest.php
Expand Up @@ -560,6 +560,32 @@ public function testEmptyValue()
$this->assertEquals(array('hash' => null), Yaml::parse($input));
}

public function testCommentAtTheRootIndent()
{
$this->assertEquals(array(
'services' => array(
'app.foo_service' => array(
'class' => 'Foo',
),
'app/bar_service' => array(
'class' => 'Bar',
),
),
), Yaml::parse(<<<EOF
# comment 1
services:
# comment 2
# comment 3
app.foo_service:
class: Foo
# comment 4
# comment 5
app/bar_service:
class: Bar
EOF
));
}

public function testStringBlockWithComments()
{
$this->assertEquals(array('content' => <<<EOT
Expand Down

0 comments on commit 7b9d519

Please sign in to comment.