use PHPUnit\Framework\TestCase;
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\LoggingTranslatorPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\Translation\Translator;
class LoggingTranslatorPassTest extends TestCase
{ public function testProcess() { $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'
]);