You are here

public function AbstractEventDispatcherTest::testAddSubscriberWithMultipleListeners in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php \Symfony\Component\EventDispatcher\Tests\AbstractEventDispatcherTest::testAddSubscriberWithMultipleListeners()

File

vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php, line 211

Class

AbstractEventDispatcherTest

Namespace

Symfony\Component\EventDispatcher\Tests

Code

public function testAddSubscriberWithMultipleListeners() {
  $eventSubscriber = new TestEventSubscriberWithMultipleListeners();
  $this->dispatcher
    ->addSubscriber($eventSubscriber);
  $listeners = $this->dispatcher
    ->getListeners('pre.foo');
  $this
    ->assertTrue($this->dispatcher
    ->hasListeners(self::preFoo));
  $this
    ->assertCount(2, $listeners);
  $this
    ->assertEquals('preFoo2', $listeners[0][1]);
}