* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\Tests\DependencyInjection; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use Symfony\Component\HttpKernel\DependencyInjection\LoggerPass; use Symfony\Component\HttpKernel\Log\Logger; use Symfony\Component\DependencyInjection\ContainerBuilder; /** * @author Kévin Dunglas */ class LoggerPassTest extends TestCase { public function testAlwaysSetAutowiringAlias() { $container = new ContainerBuilder(); $container->register('logger', 'Foo'); (new LoggerPass())->process($container); $this->assertFalse($container->getAlias(LoggerInterface::class)->isPublic()); } public function testDoNotOverrideExistingLogger() { $container = new ContainerBuilder(); $container->register('logger', 'Foo'); (new LoggerPass())->process($container); $this->assertSame('Foo', $container->getDefinition('logger')->getClass()); } public function testRegisterLogger() { $container = new ContainerBuilder(); $container->setParameter('kernel.debug', false); (new LoggerPass())->process($container); $definition = $container->getDefinition('logger'); $this->assertSame(Logger::class, $definition->getClass()); $this->assertFalse($definition->isPublic()); } } __halt_compiler();----SIGNATURE:----om2NR1KoO2C4gU2X8uonoOjoruv83LCL8vm23dj17aZyAHzsgoGCxc3tB8weYB36KpmR10XsLdPIhmJPFhe7cJ+wCQSD1izdWwcg+NJi5vei41XQwYGmg6Xg3qnI5nNPAodF6rAHMp9LutcvFX1nmMAcHH7pNVYQQywbqPyvsfe+Z5h0LYHIGVIxliEXLL039G+2aZ6CGAZgH8cKLpY1sXdcS8Q1GilQPW2TOYfaSQ9QujwYV4/FQTWQ3cp8VroQs45BjSywsopKdnURmN/Tvm87cbXNxCcwdbYKjMqwOWKwHoFYTj1UfnQrJyenBI0Guf5MGS1WDVJDoQOdsYm6OWKSuXWPVVB5a/w0weRJiWwjehh7VDZnb5qdVNELnPopgIHnBfCW6KgDeSAix/RATA0QmWCnHr5wDEdecgFjY6ZuXkfG9U40Wwz+ZE06oP6hgAe7WvJSAdbjVg4EERo8dwgMYNjF3Z+YdTw1t6sepoYvttAVGGM/a48no1WuQt/c2Bnbgp/9WiuhEFvFbFV6SogEbkmpYdmW72IztQzh7kAfXGcy4rKa91CtUfMFvRD80/EkP3F8/iF36lD4g8WBAzKBgAxGhi2xA6T+b8slqAmOWX4Mn5LFk9J/7ETqMjK3KtbLKPVRZKg7/CyN6FP+VZCMgXssqgCUUJlSiY+eIKk=----ATTACHMENT:----NTcxMjkzMDQwNDMxNDE4MSAxNjQ5MTAwMjIxMzQ1NzEzIDgwNTUzOTcyMDY3NTYwMTc=