public function RemoveUnusedDefinitionsPassTest::testProcessWontRemovePrivateFactory in Service Container 7
Same name and namespace in other branches
- 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php \Symfony\Component\DependencyInjection\Tests\Compiler\RemoveUnusedDefinitionsPassTest::testProcessWontRemovePrivateFactory()
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Tests/ Compiler/ RemoveUnusedDefinitionsPassTest.php, line 83
Class
Namespace
Symfony\Component\DependencyInjection\Tests\CompilerCode
public function testProcessWontRemovePrivateFactory() {
$container = new ContainerBuilder();
$container
->register('foo', 'stdClass')
->setFactory(array(
'stdClass',
'getInstance',
))
->setPublic(false);
$container
->register('bar', 'stdClass')
->setFactory(array(
new Reference('foo'),
'getInstance',
))
->setPublic(false);
$container
->register('foobar')
->addArgument(new Reference('bar'));
$this
->process($container);
$this
->assertTrue($container
->hasDefinition('foo'));
$this
->assertTrue($container
->hasDefinition('bar'));
$this
->assertTrue($container
->hasDefinition('foobar'));
}