You are here

public function RegisterListenersPassTest::testPrivateEventListener in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/event-dispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php \Symfony\Component\EventDispatcher\Tests\DependencyInjection\RegisterListenersPassTest::testPrivateEventListener()

@expectedException \InvalidArgumentException @expectedExceptionMessage The service "foo" must be public as event listeners are lazy-loaded.

File

vendor/symfony/event-dispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php, line 104

Class

RegisterListenersPassTest

Namespace

Symfony\Component\EventDispatcher\Tests\DependencyInjection

Code

public function testPrivateEventListener() {
  $container = new ContainerBuilder();
  $container
    ->register('foo', 'stdClass')
    ->setPublic(false)
    ->addTag('kernel.event_listener', array());
  $container
    ->register('event_dispatcher', 'stdClass');
  $registerListenersPass = new RegisterListenersPass();
  $registerListenersPass
    ->process($container);
}