$container =
new ContainerBuilder();
$loader =
new YamlFileLoader($container,
new FileLocator(self::
$fixturesPath.'/yaml'
));
$loader->
load('services2.yml'
);
$this->
assertEquals(['foo' => 'bar', 'mixedcase' =>
['MixedCaseKey' => 'value'
], 'values' =>
[true, false, 0, 1000.3, \PHP_INT_MAX
], 'bar' => 'foo', 'escape' => '@escapeme', 'foo_bar' =>
new Reference('foo_bar'
)],
$container->
getParameterBag()->
all(), '->load() converts YAML keys to lowercase'
);
} public function testLoadImports() { $container =
new ContainerBuilder();
$resolver =
new LoaderResolver([ new IniFileLoader($container,
new FileLocator(self::
$fixturesPath.'/ini'
)),
new XmlFileLoader($container,
new FileLocator(self::
$fixturesPath.'/xml'
)),
new PhpFileLoader($container,
new FileLocator(self::
$fixturesPath.'/php'
)),
$loader =
new YamlFileLoader($container,
new FileLocator(self::
$fixturesPath.'/yaml'
)),
]);
$loader->
setResolver($resolver);
$loader->
load('services4.yml'
);
$actual =
$container->
getParameterBag()->
all();
$expected =
[ 'foo' => 'bar',
'values' =>
[true, false, \PHP_INT_MAX
],