4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\DependencyInjection\Tests\Compiler;
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\DependencyInjection\Compiler\ResolvePrivatesPass;
16 use Symfony\Component\DependencyInjection\ContainerBuilder;
18 class ResolvePrivatesPassTest extends TestCase
20 public function testPrivateHasHigherPrecedenceThanPublic()
22 $container = new ContainerBuilder();
24 $container->register('foo', 'stdClass')
29 $container->setAlias('bar', 'foo')
34 (new ResolvePrivatesPass())->process($container);
36 $this->assertFalse($container->getDefinition('foo')->isPublic());
37 $this->assertFalse($container->getAlias('bar')->isPublic());