public function TraceableEventDispatcherTest::testGetCalledListenersNested in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/event-dispatcher/Tests/Debug/TraceableEventDispatcherTest.php \Symfony\Component\EventDispatcher\Tests\Debug\TraceableEventDispatcherTest::testGetCalledListenersNested()
File
- vendor/
symfony/ event-dispatcher/ Tests/ Debug/ TraceableEventDispatcherTest.php, line 90
Class
Namespace
Symfony\Component\EventDispatcher\Tests\DebugCode
public function testGetCalledListenersNested() {
$tdispatcher = null;
$dispatcher = new TraceableEventDispatcher(new EventDispatcher(), new Stopwatch());
$dispatcher
->addListener('foo', function (Event $event, $eventName, $dispatcher) use (&$tdispatcher) {
$tdispatcher = $dispatcher;
$dispatcher
->dispatch('bar');
});
$dispatcher
->addListener('bar', function (Event $event) {
});
$dispatcher
->dispatch('foo');
$this
->assertSame($dispatcher, $tdispatcher);
$this
->assertCount(2, $dispatcher
->getCalledListeners());
}