8000 minor #16074 [Yaml] Add regression test for comments indents (ogizanagi) · symfony/symfony@351bccb · GitHub
[go: up one dir, main page]

Skip to content

Commit 351bccb

Browse files
committed
minor #16074 [Yaml] Add regression test for comments indents (ogizanagi)
This PR was merged into the 2.3 branch. Discussion ---------- [Yaml] Add regression test for comments indents | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - This is related to #16065, #15857 and #15860 (last one has been reverted due to this regression) Commits ------- 7b9d519 [Yaml] Add regression test for comments indents
2 parents 510fdea + 7b9d519 commit 351bccb

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/Symfony/Component/Yaml/Tests/ParserTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,32 @@ public function testEmptyValue()
560560
$this->assertEquals(array('hash' => null), Yaml::parse($input));
561561
}
562562

563+
public function testCommentAtTheRootIndent()
564+
{
565+
$this->assertEquals(array(
566+
'services' => array(
567+
'app.foo_service' => array(
568+
'class' => 'Foo',
569+
),
570+
'app/bar_service' => array(
571+
'class' => 'Bar',
572+
),
573+
),
574+
), Yaml::parse(<<<EOF
575+
# comment 1
576+
services:
577+
# comment 2
578+
# comment 3
579+
app.foo_service:
580+
class: Foo
581+
# comment 4
582+
# comment 5
583+
app/bar_service:
584+
class: Bar
585+
EOF
586+
));
587+
}
588+
563589
public function testStringBlockWithComments()
564590
{
565591
$this->assertEquals(array('content' => <<<EOT

0 commit comments

Comments
 (0)
0