removeEventListener() public method

Removes an event listener for the given event name.
See also: EventDispatcherInterface::removeListener()
public removeEventListener ( string $eventName, callable $listener ) : static
$eventName string The event name.
$listener callable The callback to remove.
return static The current instance.
コード例 #1
0
 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);
 }