You are here

public function ParserTest::testReferenceResolvingInInlineStrings in Lockr 7.3

File

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

Class

ParserTest

Namespace

Symfony\Component\Yaml\Tests

Code

public function testReferenceResolvingInInlineStrings() {
  $this
    ->assertEquals([
    'var' => 'var-value',
    'scalar' => 'var-value',
    'list' => [
      'var-value',
    ],
    'list_in_list' => [
      [
        'var-value',
      ],
    ],
    'map_in_list' => [
      [
        'key' => 'var-value',
      ],
    ],
    'embedded_mapping' => [
      [
        'key' => 'var-value',
      ],
    ],
    'map' => [
      'key' => 'var-value',
    ],
    'list_in_map' => [
      'key' => [
        'var-value',
      ],
    ],
    'map_in_map' => [
      'foo' => [
        'bar' => 'var-value',
      ],
    ],
  ], Yaml::parse(<<<'EOF'
var:  &var var-value
scalar: *var
list: [ *var ]
list_in_list: [[ *var ]]
map_in_list: [ { key: *var } ]
embedded_mapping: [ key: *var ]
map: { key: *var }
list_in_map: { key: [*var] }
map_in_map: { foo: { bar: *var } }
EOF
));
}