public function testAddSubscriberWithPriorities() {
$eventSubscriber = new TestEventSubscriber();
$this->dispatcher
->addSubscriber($eventSubscriber);
$eventSubscriber = new TestEventSubscriberWithPriorities();
$this->dispatcher
->addSubscriber($eventSubscriber);
$listeners = $this->dispatcher
->getListeners('pre.foo');
$this
->assertTrue($this->dispatcher
->hasListeners(self::preFoo));
$this
->assertCount(2, $listeners);
$this
->assertInstanceOf('Symfony\\Component\\EventDispatcher\\Tests\\TestEventSubscriberWithPriorities', $listeners[0][0]);
}