You are here

public function ParserTest::testMappingDuplicateKeyBlock in Loft Data Grids 7.2

> 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.

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 734

Class

ParserTest

Namespace

Symfony\Component\Yaml\Tests

Code

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));
}