public function AbstractEventDispatcherTest::testDispatchForClosure in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php \Symfony\Component\EventDispatcher\Tests\AbstractEventDispatcherTest::testDispatchForClosure()
File
- vendor/
symfony/ event-dispatcher/ Tests/ AbstractEventDispatcherTest.php, line 135
Class
Namespace
Symfony\Component\EventDispatcher\TestsCode
public function testDispatchForClosure() {
$invoked = 0;
$listener = function () use (&$invoked) {
++$invoked;
};
$this->dispatcher
->addListener('pre.foo', $listener);
$this->dispatcher
->addListener('post.foo', $listener);
$this->dispatcher
->dispatch(self::preFoo);
$this
->assertEquals(1, $invoked);
}