public function ContainerBuilderTest::testRegister in Service Container 7.2
Same name and namespace in other branches
- 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php \Symfony\Component\DependencyInjection\Tests\ContainerBuilderTest::testRegister()
@covers Symfony\Component\DependencyInjection\ContainerBuilder::register
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Tests/ ContainerBuilderTest.php, line 69
Class
Namespace
Symfony\Component\DependencyInjection\TestsCode
public function testRegister() {
$builder = new ContainerBuilder();
$builder
->register('foo', 'Bar\\FooClass');
$this
->assertTrue($builder
->hasDefinition('foo'), '->register() registers a new service definition');
$this
->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Definition', $builder
->getDefinition('foo'), '->register() returns the newly created Definition instance');
}