Removes an event listener for the given event name.
public removeEventListener ( string $eventName, callable $listener ) : static | ||
$eventName | string | The event name. |
$listener | callable | The callback to remove. |
return | static | The current instance. |
public function testRemoveEventListener() { $dispatcher = $this->getMock('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface'); $listener = function () { }; $dispatcher->expects($this->once())->method('removeListener')->with('event-name', $listener); $this->config->setEventDispatcher($dispatcher); $this->config->removeEventListener('event-name', $listener); }