You are here

public function AbstractEventDispatcherTest::testRemoveListener in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php \Symfony\Component\EventDispatcher\Tests\AbstractEventDispatcherTest::testRemoveListener()

File

vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php, line 180

Class

AbstractEventDispatcherTest

Namespace

Symfony\Component\EventDispatcher\Tests

Code

public function testRemoveListener() {
  $this->dispatcher
    ->addListener('pre.bar', $this->listener);
  $this
    ->assertTrue($this->dispatcher
    ->hasListeners(self::preBar));
  $this->dispatcher
    ->removeListener('pre.bar', $this->listener);
  $this
    ->assertFalse($this->dispatcher
    ->hasListeners(self::preBar));
  $this->dispatcher
    ->removeListener('notExists', $this->listener);
}