Skip to content

Commit bb64fc9

Browse files
committed
[Yaml] simplify the test
1 parent 7fa1257 commit bb64fc9

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2381,19 +2381,13 @@ public function testParsingMultipleDocuments()
23812381
c: d
23822382
YAML;
23832383

2384-
$expected = ['a' => ['b' => "row\nrow2\n"], 'c' => 'd'];
2385-
2386-
// The parser was not used before, so there is a new line after row2
2387-
$this->assertSame($expected, $this->parser->parse($longDocument));
2388-
2389-
$parser = new Parser();
23902384
// The first parsing set and fixed the totalNumberOfLines in the Parser before, so parsing the short document here
23912385
// to reproduce the issue. If the issue would not have been fixed, the next assertion will fail
2392-
$parser->parse($shortDocument);
2386+
$this->parser->parse($shortDocument);
23932387

2394-
// After the total number of lines has been rset the result will be the same as if a new parser was used
2388+
// After the total number of lines has been reset the result will be the same as if a new parser was used
23952389
// (before, there was no \n after row2)
2396-
$this->assertSame($expected, $parser->parse($longDocument));
2390+
$this->assertSame(['a' => ['b' => "row\nrow2\n"], 'c' => 'd'], $this->parser->parse($longDocument));
23972391
}
23982392
}
23992393

0 commit comments

Comments
 (0)