public function TraceableEventDispatcherTest::testAddRemoveSubscriber 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::testAddRemoveSubscriber()
File
- vendor/
symfony/ event-dispatcher/ Tests/ Debug/ TraceableEventDispatcherTest.php, line 59
Class
Namespace
Symfony\Component\EventDispatcher\Tests\DebugCode
public function testAddRemoveSubscriber() {
$dispatcher = new EventDispatcher();
$tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch());
$subscriber = new EventSubscriber();
$tdispatcher
->addSubscriber($subscriber);
$listeners = $dispatcher
->getListeners('foo');
$this
->assertCount(1, $listeners);
$this
->assertSame(array(
$subscriber,
'call',
), $listeners[0]);
$tdispatcher
->removeSubscriber($subscriber);
$this
->assertCount(0, $dispatcher
->getListeners('foo'));
}