public function testRemoveAfterDispatch() {
$event = new Event();
$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
->dispatch('onEvent', new Event());
$dispatcher
->removeListener('onEvent', array(
$container
->get('service.listener'),
'onEvent',
));
$this
->assertFalse($dispatcher
->hasListeners('onEvent'));
}