Yaffs site version 1.1
[yaffs-website] / vendor / symfony / http-kernel / Tests / DependencyInjection / MergeExtensionConfigurationPassTest.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\HttpKernel\Tests\DependencyInjection;
13
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;
16
17 class MergeExtensionConfigurationPassTest extends TestCase
18 {
19     public function testAutoloadMainExtension()
20     {
21         $container = $this->getMockBuilder('Symfony\\Component\\DependencyInjection\\ContainerBuilder')->setMethods(array('getExtensionConfig', 'loadFromExtension', 'getParameterBag', 'getDefinitions', 'getAliases', 'getExtensions'))->getMock();
22         $params = $this->getMockBuilder('Symfony\\Component\\DependencyInjection\\ParameterBag\\ParameterBag')->getMock();
23
24         $container->expects($this->at(0))
25             ->method('getExtensionConfig')
26             ->with('loaded')
27             ->will($this->returnValue(array(array())));
28         $container->expects($this->at(1))
29             ->method('getExtensionConfig')
30             ->with('notloaded')
31             ->will($this->returnValue(array()));
32         $container->expects($this->once())
33             ->method('loadFromExtension')
34             ->with('notloaded', array());
35
36         $container->expects($this->any())
37             ->method('getParameterBag')
38             ->will($this->returnValue($params));
39         $params->expects($this->any())
40             ->method('all')
41             ->will($this->returnValue(array()));
42         $container->expects($this->any())
43             ->method('getDefinitions')
44             ->will($this->returnValue(array()));
45         $container->expects($this->any())
46             ->method('getAliases')
47             ->will($this->returnValue(array()));
48         $container->expects($this->any())
49             ->method('getExtensions')
50             ->will($this->returnValue(array()));
51
52         $configPass = new MergeExtensionConfigurationPass(array('loaded', 'notloaded'));
53         $configPass->process($container);
54     }
55 }