You are here

public function AbstractEventDispatcherTest::testRemoveSubscriberWithMultipleListeners in Zircon Profile 8

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

File

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

Class

AbstractEventDispatcherTest

Namespace

Symfony\Component\EventDispatcher\Tests

Code

public function testRemoveSubscriberWithMultipleListeners() {
  $eventSubscriber = new TestEventSubscriberWithMultipleListeners();
  $this->dispatcher
    ->addSubscriber($eventSubscriber);
  $this
    ->assertTrue($this->dispatcher
    ->hasListeners(self::preFoo));
  $this
    ->assertCount(2, $this->dispatcher
    ->getListeners(self::preFoo));
  $this->dispatcher
    ->removeSubscriber($eventSubscriber);
  $this
    ->assertFalse($this->dispatcher
    ->hasListeners(self::preFoo));
}