You are here

class TestEventListener in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Component/EventDispatcher/ContainerAwareEventDispatcherTest.php \Drupal\Tests\Component\EventDispatcher\TestEventListener
  2. 9 core/tests/Drupal/Tests/Component/EventDispatcher/ContainerAwareEventDispatcherTest.php \Drupal\Tests\Component\EventDispatcher\TestEventListener

Hierarchy

Expanded class hierarchy of TestEventListener

File

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

Namespace

Drupal\Tests\Component\EventDispatcher
View source
class TestEventListener {
  public $preFooInvoked = FALSE;
  public $postFooInvoked = FALSE;

  /**
   * Listener methods.
   */
  public function preFoo(Event $e) {
    $this->preFooInvoked = TRUE;
  }
  public function postFoo(Event $e) {
    $this->postFooInvoked = TRUE;
    $e
      ->stopPropagation();
  }

}

Members