public function TraceableEventDispatcherTest::testDispatchReusedEventNested 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::testDispatchReusedEventNested()
File
- vendor/
symfony/ event-dispatcher/ Tests/ Debug/ TraceableEventDispatcherTest.php, line 163
Class
Namespace
Symfony\Component\EventDispatcher\Tests\DebugCode
public function testDispatchReusedEventNested() {
$nestedCall = false;
$dispatcher = new TraceableEventDispatcher(new EventDispatcher(), new Stopwatch());
$dispatcher
->addListener('foo', function (Event $e) use ($dispatcher) {
$dispatcher
->dispatch('bar', $e);
});
$dispatcher
->addListener('bar', function (Event $e) use (&$nestedCall) {
$nestedCall = true;
});
$this
->assertFalse($nestedCall);
$dispatcher
->dispatch('foo');
$this
->assertTrue($nestedCall);
}