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\HttpKernel\Tests\DependencyInjection;
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;
17 class MergeExtensionConfigurationPassTest extends TestCase
19 public function testAutoloadMainExtension()
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();
24 $container->expects($this->at(0))
25 ->method('getExtensionConfig')
27 ->will($this->returnValue(array(array())));
28 $container->expects($this->at(1))
29 ->method('getExtensionConfig')
31 ->will($this->returnValue(array()));
32 $container->expects($this->once())
33 ->method('loadFromExtension')
34 ->with('notloaded', array());
36 $container->expects($this->any())
37 ->method('getParameterBag')
38 ->will($this->returnValue($params));
39 $params->expects($this->any())
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()));
52 $configPass = new MergeExtensionConfigurationPass(array('loaded', 'notloaded'));
53 $configPass->process($container);