public function ContainerBuilderTest::testfindTaggedServiceIds in Service Container 7
Same name and namespace in other branches
- 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php \Symfony\Component\DependencyInjection\Tests\ContainerBuilderTest::testfindTaggedServiceIds()
@covers Symfony\Component\DependencyInjection\ContainerBuilder::findTaggedServiceIds
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Tests/ ContainerBuilderTest.php, line 511
Class
Namespace
Symfony\Component\DependencyInjection\TestsCode
public function testfindTaggedServiceIds() {
$builder = new ContainerBuilder();
$builder
->register('foo', 'Bar\\FooClass')
->addTag('foo', array(
'foo' => 'foo',
))
->addTag('bar', array(
'bar' => 'bar',
))
->addTag('foo', array(
'foofoo' => 'foofoo',
));
$this
->assertEquals($builder
->findTaggedServiceIds('foo'), array(
'foo' => array(
array(
'foo' => 'foo',
),
array(
'foofoo' => 'foofoo',
),
),
), '->findTaggedServiceIds() returns an array of service ids and its tag attributes');
$this
->assertEquals(array(), $builder
->findTaggedServiceIds('foobar'), '->findTaggedServiceIds() returns an empty array if there is annotated services');
}