public function ContainerAwareEventDispatcherTest::testRemoveBeforeDispatch in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/event-dispatcher/Tests/ContainerAwareEventDispatcherTest.php \Symfony\Component\EventDispatcher\Tests\ContainerAwareEventDispatcherTest::testRemoveBeforeDispatch()
File
- vendor/
symfony/ event-dispatcher/ Tests/ ContainerAwareEventDispatcherTest.php, line 215
Class
Namespace
Symfony\Component\EventDispatcher\TestsCode
public function testRemoveBeforeDispatch() {
$service = $this
->getMock('Symfony\\Component\\EventDispatcher\\Tests\\Service');
$container = new Container();
$container
->set('service.listener', $service);
$dispatcher = new ContainerAwareEventDispatcher($container);
$dispatcher
->addListenerService('onEvent', array(
'service.listener',
'onEvent',
));
$dispatcher
->removeListener('onEvent', array(
$container
->get('service.listener'),
'onEvent',
));
$this
->assertFalse($dispatcher
->hasListeners('onEvent'));
}