public function AbstractEventDispatcherTest::testRemoveSubscriber in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php \Symfony\Component\EventDispatcher\Tests\AbstractEventDispatcherTest::testRemoveSubscriber()
File
- vendor/
symfony/ event-dispatcher/ Tests/ AbstractEventDispatcherTest.php, line 222
Class
Namespace
Symfony\Component\EventDispatcher\TestsCode
public function testRemoveSubscriber() {
$eventSubscriber = new TestEventSubscriber();
$this->dispatcher
->addSubscriber($eventSubscriber);
$this
->assertTrue($this->dispatcher
->hasListeners(self::preFoo));
$this
->assertTrue($this->dispatcher
->hasListeners(self::postFoo));
$this->dispatcher
->removeSubscriber($eventSubscriber);
$this
->assertFalse($this->dispatcher
->hasListeners(self::preFoo));
$this
->assertFalse($this->dispatcher
->hasListeners(self::postFoo));
}