You are here

public function AbstractEventDispatcherTest::testEventReceivesTheDispatcherInstanceAsArgument 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::testEventReceivesTheDispatcherInstanceAsArgument()

File

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

Class

AbstractEventDispatcherTest

Namespace

Symfony\Component\EventDispatcher\Tests

Code

public function testEventReceivesTheDispatcherInstanceAsArgument() {
  $listener = new TestWithDispatcher();
  $this->dispatcher
    ->addListener('test', array(
    $listener,
    'foo',
  ));
  $this
    ->assertNull($listener->name);
  $this
    ->assertNull($listener->dispatcher);
  $this->dispatcher
    ->dispatch('test');
  $this
    ->assertEquals('test', $listener->name);
  $this
    ->assertSame($this->dispatcher, $listener->dispatcher);
}