Geen omschrijving

MergeExtensionConfigurationPassTest.php 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\HttpKernel\Tests\DependencyInjection;
  11. use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;
  12. class MergeExtensionConfigurationPassTest extends \PHPUnit_Framework_TestCase
  13. {
  14. public function testAutoloadMainExtension()
  15. {
  16. $container = $this->getMockBuilder('Symfony\\Component\\DependencyInjection\\ContainerBuilder')->setMethods(array('getExtensionConfig', 'loadFromExtension', 'getParameterBag', 'getDefinitions', 'getAliases', 'getExtensions'))->getMock();
  17. $params = $this->getMockBuilder('Symfony\\Component\\DependencyInjection\\ParameterBag\\ParameterBag')->getMock();
  18. $container->expects($this->at(0))
  19. ->method('getExtensionConfig')
  20. ->with('loaded')
  21. ->will($this->returnValue(array(array())));
  22. $container->expects($this->at(1))
  23. ->method('getExtensionConfig')
  24. ->with('notloaded')
  25. ->will($this->returnValue(array()));
  26. $container->expects($this->once())
  27. ->method('loadFromExtension')
  28. ->with('notloaded', array());
  29. $container->expects($this->any())
  30. ->method('getParameterBag')
  31. ->will($this->returnValue($params));
  32. $params->expects($this->any())
  33. ->method('all')
  34. ->will($this->returnValue(array()));
  35. $container->expects($this->any())
  36. ->method('getDefinitions')
  37. ->will($this->returnValue(array()));
  38. $container->expects($this->any())
  39. ->method('getAliases')
  40. ->will($this->returnValue(array()));
  41. $container->expects($this->any())
  42. ->method('getExtensions')
  43. ->will($this->returnValue(array()));
  44. $configPass = new MergeExtensionConfigurationPass(array('loaded', 'notloaded'));
  45. $configPass->process($container);
  46. }
  47. }