public function ParserTest::testMappingDuplicateKeyBlock in Lockr 7.3
> 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.
@group legacy
See also
http://yaml.org/spec/1.2/spec.html#id2759572
http://yaml.org/spec/1.1/#id932806
File
- vendor/
symfony/ yaml/ Tests/ ParserTest.php, line 915
Class
Namespace
Symfony\Component\Yaml\TestsCode
public function testMappingDuplicateKeyBlock() {
$input = <<<'EOD'
parent:
child: first
child: duplicate
parent:
child: duplicate
child: duplicate
EOD;
$expected = [
'parent' => [
'child' => 'first',
],
];
$this
->assertSame($expected, Yaml::parse($input));
}