public function ContainerTest::testCompile in Service Container 7.2
Same name and namespace in other branches
- 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/ContainerTest.php \Symfony\Component\DependencyInjection\Tests\ContainerTest::testCompile()
@covers Symfony\Component\DependencyInjection\Container::compile
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Tests/ ContainerTest.php, line 81
Class
Namespace
Symfony\Component\DependencyInjection\TestsCode
public function testCompile() {
$sc = new Container(new ParameterBag(array(
'foo' => 'bar',
)));
$this
->assertFalse($sc
->getParameterBag()
->isResolved(), '->compile() resolves the parameter bag');
$sc
->compile();
$this
->assertTrue($sc
->getParameterBag()
->isResolved(), '->compile() resolves the parameter bag');
$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');
}