public function ParserTest::testReferenceResolvingInInlineStrings in Plug 7
File
- lib/
Symfony/ yaml/ Symfony/ Component/ Yaml/ Tests/ ParserTest.php, line 699
Class
Namespace
Symfony\Component\Yaml\TestsCode
public function testReferenceResolvingInInlineStrings() {
$this
->assertEquals(array(
'var' => 'var-value',
'scalar' => 'var-value',
'list' => array(
'var-value',
),
'list_in_list' => array(
array(
'var-value',
),
),
'map_in_list' => array(
array(
'key' => 'var-value',
),
),
'embedded_mapping' => array(
array(
'key' => 'var-value',
),
),
'map' => array(
'key' => 'var-value',
),
'list_in_map' => array(
'key' => array(
'var-value',
),
),
'map_in_map' => array(
'foo' => array(
'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
));
}