You are here

public function ContainerBuilderTest::testExtensionConfig in Service Container 7.2

Same name and namespace in other branches
  1. 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php \Symfony\Component\DependencyInjection\Tests\ContainerBuilderTest::testExtensionConfig()

@covers Symfony\Component\DependencyInjection\ContainerBuilder::getExtensionConfig @covers Symfony\Component\DependencyInjection\ContainerBuilder::prependExtensionConfig

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php, line 801

Class

ContainerBuilderTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testExtensionConfig() {
  $container = new ContainerBuilder();
  $configs = $container
    ->getExtensionConfig('foo');
  $this
    ->assertEmpty($configs);
  $first = array(
    'foo' => 'bar',
  );
  $container
    ->prependExtensionConfig('foo', $first);
  $configs = $container
    ->getExtensionConfig('foo');
  $this
    ->assertEquals(array(
    $first,
  ), $configs);
  $second = array(
    'ding' => 'dong',
  );
  $container
    ->prependExtensionConfig('foo', $second);
  $configs = $container
    ->getExtensionConfig('foo');
  $this
    ->assertEquals(array(
    $second,
    $first,
  ), $configs);
}