Security update for Core, with self-updated composer
[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
27         $pass1 = $this->getMockBuilder(CompilerPassInterface::class)->getMock();
28         $config->addPass($pass1, PassConfig::TYPE_BEFORE_OPTIMIZATION, 10);
29
30         $pass2 = $this->getMockBuilder(CompilerPassInterface::class)->getMock();
31         $config->addPass($pass2, PassConfig::TYPE_BEFORE_OPTIMIZATION, 30);
32
33         $this->assertSame(array($pass2, $pass1), $config->getBeforeOptimizationPasses());
34     }
35 }