$container =
new ContainerBuilder();
$container->
setParameter('translator.logging', true
);
$container->
setParameter('translator.class', Translator::
class);
$container->
register('monolog.logger'
);
$container->
setAlias('logger', 'monolog.logger'
);
$container->
register('translator.default', '%translator.class%'
);
$container->
register('translator.logging', '%translator.class%'
);
$container->
setAlias('translator', 'translator.default'
);
$translationWarmerDefinition =
$container->
register('translation.warmer'
) ->
addArgument(new Reference('translator'
)) ->
addTag('container.service_subscriber',
['id' => 'translator'
]) ->
addTag('container.service_subscriber',
['id' => 'foo'
]);
$pass =
new LoggingTranslatorPass();
$pass->
process($container);
$this->
assertEquals( ['container.service_subscriber' =>
[ ['id' => 'foo'
],
['key' => 'translator', 'id' => 'translator.logging.inner'
],
]],
$translationWarmerDefinition->
getTags() );