public function EventDispatcherTest::testEventReceivesTheDispatcherInstance

File

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

Class

EventDispatcherTest

Namespace

Symfony\Component\EventDispatcher\Tests

Code

public function testEventReceivesTheDispatcherInstance() {
  $test = $this;
  $this->dispatcher
    ->addListener('test', function ($event) use (&$dispatcher) {
    $dispatcher = $event
      ->getDispatcher();
  });
  $this->dispatcher
    ->dispatch('test');
  $this
    ->assertSame($this->dispatcher, $dispatcher);
}