8000 [Yaml] simplify the test by xabbuh · Pull Request #38235 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Yaml] simplify the test #38235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions src/Symfony/Component/Yaml/Tests/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2381,19 +2381,13 @@ public function testParsingMultipleDocuments()
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));
}
}

Expand Down
0