public function ContainerAwareEventDispatcherTest::testHasListenersWhenAddedCallbackListenerIsRemoved in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Component/EventDispatcher/ContainerAwareEventDispatcherTest.php \Drupal\Tests\Component\EventDispatcher\ContainerAwareEventDispatcherTest::testHasListenersWhenAddedCallbackListenerIsRemoved()
- 9 core/tests/Drupal/Tests/Component/EventDispatcher/ContainerAwareEventDispatcherTest.php \Drupal\Tests\Component\EventDispatcher\ContainerAwareEventDispatcherTest::testHasListenersWhenAddedCallbackListenerIsRemoved()
File
- core/
tests/ Drupal/ Tests/ Component/ EventDispatcher/ ContainerAwareEventDispatcherTest.php, line 448
Class
- ContainerAwareEventDispatcherTest
- Unit tests for the ContainerAwareEventDispatcher.
Namespace
Drupal\Tests\Component\EventDispatcherCode
public function testHasListenersWhenAddedCallbackListenerIsRemoved() {
$listener = function () {
};
$this->dispatcher
->addListener('foo', $listener);
$this->dispatcher
->removeListener('foo', $listener);
$this
->assertFalse($this->dispatcher
->hasListeners());
}