class TestEventListener

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Component/EventDispatcher/ContainerAwareEventDispatcherTest.php \Drupal\Tests\Component\EventDispatcher\TestEventListener
  2. 8.9.x core/tests/Drupal/Tests/Component/EventDispatcher/ContainerAwareEventDispatcherTest.php \Drupal\Tests\Component\EventDispatcher\TestEventListener
  3. 10 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 564

Namespace

Drupal\Tests\Component\EventDispatcher
View source
class TestEventListener {
    public $name;
    public $preFooInvoked = FALSE;
    public $postFooInvoked = FALSE;
    
    /**
     * Listener methods.
     */
    public function preFoo(object $e) {
        $this->preFooInvoked = TRUE;
    }
    public function postFoo(Event $e) {
        $this->postFooInvoked = TRUE;
        $e->stopPropagation();
    }

}

Members

Title Sort descending Modifiers Object type Summary
TestEventListener::$name public property
TestEventListener::$postFooInvoked public property
TestEventListener::$preFooInvoked public property
TestEventListener::postFoo public function
TestEventListener::preFoo public function Listener methods.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.