You are here

public function ParserTest::testParseReferencesOnMergeKeysWithMappingsParsedAsObjects in Lockr 7.3

File

vendor/symfony/yaml/Tests/ParserTest.php, line 2140

Class

ParserTest

Namespace

Symfony\Component\Yaml\Tests

Code

public function testParseReferencesOnMergeKeysWithMappingsParsedAsObjects() {
  $yaml = <<<YAML
mergekeyrefdef:
    a: foo
    <<: &quux
        b: bar
        c: baz
mergekeyderef:
    d: quux
    <<: *quux
YAML;
  $expected = (object) [
    'mergekeyrefdef' => (object) [
      'a' => 'foo',
      'b' => 'bar',
      'c' => 'baz',
    ],
    'mergekeyderef' => (object) [
      'd' => 'quux',
      'b' => 'bar',
      'c' => 'baz',
    ],
  ];
  $this
    ->assertEquals($expected, $this->parser
    ->parse($yaml, Yaml::PARSE_OBJECT_FOR_MAP));
}