You are here

public function ContainerBuilderTest::testFindDefinition 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::testFindDefinition()

@covers Symfony\Component\DependencyInjection\ContainerBuilder::findDefinition

File

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

Class

ContainerBuilderTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testFindDefinition() {
  $container = new ContainerBuilder();
  $container
    ->setDefinition('foo', $definition = new Definition('Bar\\FooClass'));
  $container
    ->setAlias('bar', 'foo');
  $container
    ->setAlias('foobar', 'bar');
  $this
    ->assertEquals($definition, $container
    ->findDefinition('foobar'), '->findDefinition() returns a Definition');
}