From b562a54e5376583e4a260e64cbcd83c8ecb4d465 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Mon, 30 Nov 2020 11:43:40 +0100 Subject: [PATCH] Added test for issue 39229 --- .../Component/Yaml/Tests/ParserTest.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/Symfony/Component/Yaml/Tests/ParserTest.php b/src/Symfony/Component/Yaml/Tests/ParserTest.php index a9715151f1..3f228a4576 100644 --- a/src/Symfony/Component/Yaml/Tests/ParserTest.php +++ b/src/Symfony/Component/Yaml/Tests/ParserTest.php @@ -2671,6 +2671,29 @@ YAML; ); } + public function testMultipleWhitespaceAtEndOfLine() + { + $yaml = "\nfoo:\n arguments: [ '@bar' ] \n"; + $this->assertSame( + [ + 'foo' => [ + 'arguments' => ['@bar'], + ], + ], + $this->parser->parse($yaml) + ); + + $yaml = "\nfoo:\n bar: {}\n"; + $this->assertSame( + [ + 'foo' => [ + 'bar' => [], + ], + ], + $this->parser->parse($yaml) + ); + } + /** * This is a regression test for a bug where a YAML block with a nested multiline string using | was parsed without * a trailing \n when a shorter YAML document was parsed before.