You are here

public function TomeStaticEventTestBase::setUp in Tome 8

Overrides KernelTestBase::setUp

File

modules/tome_static/tests/src/Kernel/TomeStaticEventTestBase.php, line 34

Class

TomeStaticEventTestBase
Helper test class with some added functions for Tome static event testing.

Namespace

Drupal\Tests\tome_static\Kernel

Code

public function setUp() {
  parent::setUp();
  $this->eventDispatcher = \Drupal::service('event_dispatcher');
  $listeners = $this->eventDispatcher
    ->getListeners($this->eventName);
  foreach ($listeners as $listener) {
    $this->eventDispatcher
      ->removeListener($this->eventName, $listener);
  }
}