public function ContainerTest::testCompile

@covers Symfony\Component\DependencyInjection\Container::compile

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerTest.php, line 36

Class

ContainerTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testCompile() {
  $sc = new Container(new ParameterBag(array(
    'foo' => 'bar',
  )));
  $sc
    ->compile();
  $this
    ->assertInstanceOf('Symfony\\Component\\DependencyInjection\\ParameterBag\\FrozenParameterBag', $sc
    ->getParameterBag(), '->compile() changes the parameter bag to a FrozenParameterBag instance');
  $this
    ->assertEquals(array(
    'foo' => 'bar',
  ), $sc
    ->getParameterBag()
    ->all(), '->compile() copies the current parameters to the new parameter bag');
}