public function ParserTest::testMappingDuplicateKeyBlock in Plug 7
> It is an error for two equal keys to appear in the same mapping node. > In such a case the YAML processor may continue, ignoring the second > `key: value` pair and issuing an appropriate warning. This strategy > preserves a consistent information model for one-pass and random access > applications.
@covers \Symfony\Component\Yaml\Parser::parse
See also
http://yaml.org/spec/1.2/spec.html#id2759572
http://yaml.org/spec/1.1/#id932806
File
- lib/
Symfony/ yaml/ Symfony/ Component/ Yaml/ Tests/ ParserTest.php, line 566
Class
Namespace
Symfony\Component\Yaml\TestsCode
public function testMappingDuplicateKeyBlock() {
$input = <<<EOD
parent:
child: first
child: duplicate
parent:
child: duplicate
child: duplicate
EOD;
$expected = array(
'parent' => array(
'child' => 'first',
),
);
$this
->assertSame($expected, Yaml::parse($input));
}