function ContainerAwareEventDispatcherTest::testRemoveSubscriberWithPriorities

Same name and namespace in other branches
  1. 8.9.x core/tests/Drupal/Tests/Component/EventDispatcher/ContainerAwareEventDispatcherTest.php \Drupal\Tests\Component\EventDispatcher\ContainerAwareEventDispatcherTest::testRemoveSubscriberWithPriorities()
  2. 10 core/tests/Drupal/Tests/Component/EventDispatcher/ContainerAwareEventDispatcherTest.php \Drupal\Tests\Component\EventDispatcher\ContainerAwareEventDispatcherTest::testRemoveSubscriberWithPriorities()
  3. 11.x core/tests/Drupal/Tests/Component/EventDispatcher/ContainerAwareEventDispatcherTest.php \Drupal\Tests\Component\EventDispatcher\ContainerAwareEventDispatcherTest::testRemoveSubscriberWithPriorities()

File

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

Class

ContainerAwareEventDispatcherTest
Unit tests for the ContainerAwareEventDispatcher.

Namespace

Drupal\Tests\Component\EventDispatcher

Code

public function testRemoveSubscriberWithPriorities() {
    $eventSubscriber = new TestEventSubscriberWithPriorities();
    $this->dispatcher
        ->addSubscriber($eventSubscriber);
    $this->assertTrue($this->dispatcher
        ->hasListeners(self::PREFOO));
    $this->dispatcher
        ->removeSubscriber($eventSubscriber);
    $this->assertFalse($this->dispatcher
        ->hasListeners(self::PREFOO));
}

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