diff --git a/src/Symfony/Component/Yaml/Parser.php b/src/Symfony/Component/Yaml/Parser.php index be72697bd339..8f38d882af19 100644 --- a/src/Symfony/Component/Yaml/Parser.php +++ b/src/Symfony/Component/Yaml/Parser.php @@ -341,7 +341,7 @@ public function parse($value, $flags = 0) try { $parsedLine = Inline::parse($line, $flags, $this->refs); - if (!is_string($value)) { + if (!is_string($parsedLine)) { $parseError = true; break; } diff --git a/src/Symfony/Component/Yaml/Tests/ParserTest.php b/src/Symfony/Component/Yaml/Tests/ParserTest.php index 38e2f78e4179..e4633196b21d 100644 --- a/src/Symfony/Component/Yaml/Tests/ParserTest.php +++ b/src/Symfony/Component/Yaml/Tests/ParserTest.php @@ -1687,6 +1687,21 @@ public function testComplexMappingNestedInSequenceThrowsParseException() $this->parser->parse($yaml); } + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + * @expectedExceptionMessage Unable to parse at line 1 (near "[parameters]"). + */ + public function testParsingIniThrowsException() + { + $ini = <<parser->parse($ini); + } + private function loadTestsFromFixtureFiles($testsFile) { $parser = new Parser();