$container->
register(TaggedLocatorConsumer::
class) ->
setAutowired(true
) ->
setPublic(true
) ;
$container->
compile();
/** @var TaggedLocatorConsumer $s */
$s =
$container->
get(TaggedLocatorConsumer::
class);
$locator =
$s->
getLocator();
self::
assertSame($container->
get(BarTagClass::
class),
$locator->
get('bar_tab_class_with_defaultmethod'
));
self::
assertSame($container->
get(FooTagClass::
class),
$locator->
get('foo'
));
} public function testTaggedLocatorConfiguredViaAttributeWithoutIndex() { $container =
new ContainerBuilder();
$container->
register(BarTagClass::
class) ->
setPublic(true
) ->
addTag('foo_bar'
) ;