You are here

public function ContainerAwareEventDispatcherTest::testSymfonyEventDispatching in Drupal 10

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Component/EventDispatcher/ContainerAwareEventDispatcherTest.php \Drupal\Tests\Component\EventDispatcher\ContainerAwareEventDispatcherTest::testSymfonyEventDispatching()

Tests dispatching Symfony events with core's event dispatcher.

File

core/tests/Drupal/Tests/Component/EventDispatcher/ContainerAwareEventDispatcherTest.php, line 151

Class

ContainerAwareEventDispatcherTest
Unit tests for the ContainerAwareEventDispatcher.

Namespace

Drupal\Tests\Component\EventDispatcher

Code

public function testSymfonyEventDispatching() {
  $container = new ContainerBuilder();
  $dispatcher = new ContainerAwareEventDispatcher($container, []);
  $dispatcher
    ->dispatch(new GenericEvent());
}