From bb64fc9c3bd8e11df1ea1b8f2c9abc391f26d412 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 18 Sep 2020 17:57:36 +0200 Subject: [PATCH] [Yaml] simplify the test --- src/Symfony/Component/Yaml/Tests/ParserTest.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/Symfony/Component/Yaml/Tests/ParserTest.php b/src/Symfony/Component/Yaml/Tests/ParserTest.php index 883d2c0c3d..7fa6ed1a55 100644 --- a/src/Symfony/Component/Yaml/Tests/ParserTest.php +++ b/src/Symfony/Component/Yaml/Tests/ParserTest.php @@ -2381,19 +2381,13 @@ a: c: d YAML; - $expected = ['a' => ['b' => "row\nrow2\n"], 'c' => 'd']; - - // The parser was not used before, so there is a new line after row2 - $this->assertSame($expected, $this->parser->parse($longDocument)); - - $parser = new Parser(); // The first parsing set and fixed the totalNumberOfLines in the Parser before, so parsing the short document here // to reproduce the issue. If the issue would not have been fixed, the next assertion will fail - $parser->parse($shortDocument); + $this->parser->parse($shortDocument); - // After the total number of lines has been rset the result will be the same as if a new parser was used + // After the total number of lines has been reset the result will be the same as if a new parser was used // (before, there was no \n after row2) - $this->assertSame($expected, $parser->parse($longDocument)); + $this->assertSame(['a' => ['b' => "row\nrow2\n"], 'c' => 'd'], $this->parser->parse($longDocument)); } }