public function EventDispatcherTest::testAddSubscriber

File

drupal/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php, line 175

Class

EventDispatcherTest

Namespace

Symfony\Component\EventDispatcher\Tests

Code

public function testAddSubscriber() {
  $eventSubscriber = new TestEventSubscriber();
  $this->dispatcher
    ->addSubscriber($eventSubscriber);
  $this
    ->assertTrue($this->dispatcher
    ->hasListeners(self::preFoo));
  $this
    ->assertTrue($this->dispatcher
    ->hasListeners(self::postFoo));
}