You are here

class MergeExtensionConfigurationPassTest in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/http-kernel/Tests/DependencyInjection/MergeExtensionConfigurationPassTest.php \Symfony\Component\HttpKernel\Tests\DependencyInjection\MergeExtensionConfigurationPassTest
  2. 8 vendor/symfony/dependency-injection/Tests/Compiler/MergeExtensionConfigurationPassTest.php \Symfony\Component\DependencyInjection\Tests\Compiler\MergeExtensionConfigurationPassTest
Same name and namespace in other branches
  1. 8.0 vendor/symfony/dependency-injection/Tests/Compiler/MergeExtensionConfigurationPassTest.php \Symfony\Component\DependencyInjection\Tests\Compiler\MergeExtensionConfigurationPassTest

Hierarchy

  • class \Symfony\Component\DependencyInjection\Tests\Compiler\MergeExtensionConfigurationPassTest extends \Symfony\Component\DependencyInjection\Tests\Compiler\PHPUnit_Framework_TestCase

Expanded class hierarchy of MergeExtensionConfigurationPassTest

File

vendor/symfony/dependency-injection/Tests/Compiler/MergeExtensionConfigurationPassTest.php, line 18

Namespace

Symfony\Component\DependencyInjection\Tests\Compiler
View source
class MergeExtensionConfigurationPassTest extends \PHPUnit_Framework_TestCase {
  public function testExpressionLanguageProviderForwarding() {
    if (true !== class_exists('Symfony\\Component\\ExpressionLanguage\\ExpressionLanguage')) {
      $this
        ->markTestSkipped('The ExpressionLanguage component isn\'t available!');
    }
    $tmpProviders = array();
    $extension = $this
      ->getMock('Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface');
    $extension
      ->expects($this
      ->any())
      ->method('getXsdValidationBasePath')
      ->will($this
      ->returnValue(false));
    $extension
      ->expects($this
      ->any())
      ->method('getNamespace')
      ->will($this
      ->returnValue('http://example.org/schema/dic/foo'));
    $extension
      ->expects($this
      ->any())
      ->method('getAlias')
      ->will($this
      ->returnValue('foo'));
    $extension
      ->expects($this
      ->once())
      ->method('load')
      ->will($this
      ->returnCallback(function (array $config, ContainerBuilder $container) use (&$tmpProviders) {
      $tmpProviders = $container
        ->getExpressionLanguageProviders();
    }));
    $provider = $this
      ->getMock('Symfony\\Component\\ExpressionLanguage\\ExpressionFunctionProviderInterface');
    $container = new ContainerBuilder(new ParameterBag());
    $container
      ->registerExtension($extension);
    $container
      ->prependExtensionConfig('foo', array(
      'bar' => true,
    ));
    $container
      ->addExpressionLanguageProvider($provider);
    $pass = new MergeExtensionConfigurationPass();
    $pass
      ->process($container);
    $this
      ->assertEquals(array(
      $provider,
    ), $tmpProviders);
  }

}

Members