Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
AcmeFooBundle example
$container
->
loadFromExtension
(
'loaded',
[
]
)
;
$configPass
=
new
MergeExtensionConfigurationPass
(
[
'loaded', 'not_loaded'
]
)
;
$configPass
->
process
(
$container
)
;
$this
->
assertTrue
(
$container
->
hasDefinition
(
'loaded.foo'
)
)
;
$this
->
assertTrue
(
$container
->
hasDefinition
(
'not_loaded.bar'
)
)
;
}
public
function
testFooBundle
(
)
{
$bundle
=
new
AcmeFooBundle
(
)
;
$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
)
;