$container =
new ContainerBuilder(new ParameterBag([ 'kernel.environment' => 'test',
'kernel.build_dir' =>
sys_get_temp_dir(),
]));
$container->
registerExtension(new LoadedExtension());
$container->
registerExtension($bundle->
getContainerExtension());
$configPass =
new MergeExtensionConfigurationPass(['loaded', 'acme_foo'
]);
$configPass->
process($container);
$this->
assertSame([[],
['bar' => 'baz'
]],
$container->
getExtensionConfig('loaded'
), '->prependExtension() prepends an extension config'
);
$this->
assertTrue($container->
hasDefinition('acme_foo.foo'
), '->loadExtension() registers a service'
);
$this->
assertTrue($container->
hasDefinition('acme_foo.bar'
), '->loadExtension() imports a service'
);
$this->
assertTrue($container->
hasParameter('acme_foo.config'
), '->loadExtension() sets a parameter'
);
$this->
assertSame(['foo' => 'bar', 'ping' => 'pong'
],
$container->
getParameter('acme_foo.config'
), '->loadConfiguration() defines and loads configurations'
);
}}class LoadedExtension extends Extension
{ public function load(array
$configs, ContainerBuilder
$container): void
{