Updating Media dependent modules to versions compatible with core Media.
[yaffs-website] / vendor / symfony / dependency-injection / Tests / Compiler / PassConfigTest.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\PassConfig;
16 use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
17
18 /**
19  * @author Guilhem N <egetick@gmail.com>
20  */
21 class PassConfigTest extends TestCase
22 {
23     public function testPassOrdering()
24     {
25         $config = new PassConfig();
26         $config->setBeforeOptimizationPasses(array());
27
28         $pass1 = $this->getMockBuilder(CompilerPassInterface::class)->getMock();
29         $config->addPass($pass1, PassConfig::TYPE_BEFORE_OPTIMIZATION, 10);
30
31         $pass2 = $this->getMockBuilder(CompilerPassInterface::class)->getMock();
32         $config->addPass($pass2, PassConfig::TYPE_BEFORE_OPTIMIZATION, 30);
33
34         $passes = $config->getBeforeOptimizationPasses();
35         $this->assertSame($pass2, $passes[0]);
36         $this->assertSame($pass1, $passes[1]);
37     }
38 }