Updating Media dependent modules to versions compatible with core Media.
[yaffs-website] / vendor / symfony / dependency-injection / Tests / Compiler / ResolvePrivatesPassTest.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\DependencyInjection\Tests\Compiler;
13
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\DependencyInjection\Compiler\ResolvePrivatesPass;
16 use Symfony\Component\DependencyInjection\ContainerBuilder;
17
18 class ResolvePrivatesPassTest extends TestCase
19 {
20     public function testPrivateHasHigherPrecedenceThanPublic()
21     {
22         $container = new ContainerBuilder();
23
24         $container->register('foo', 'stdClass')
25             ->setPublic(true)
26             ->setPrivate(true)
27         ;
28
29         $container->setAlias('bar', 'foo')
30             ->setPublic(false)
31             ->setPrivate(false)
32         ;
33
34         (new ResolvePrivatesPass())->process($container);
35
36         $this->assertFalse($container->getDefinition('foo')->isPublic());
37         $this->assertFalse($container->getAlias('bar')->isPublic());
38     }
39 }