public function ParserTest::testMappingDuplicateKeyBlock in Service Container 7.2
Same name and namespace in other branches
- 7 modules/providers/service_container_symfony/lib/Symfony/Component/Yaml/Tests/ParserTest.php \Symfony\Component\Yaml\Tests\ParserTest::testMappingDuplicateKeyBlock()
> 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
- modules/
providers/ service_container_symfony/ lib/ 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));
}