/** * Test dispatch and event name in disabled list */ public function testDispatchWithEventNameIsDisabledForNotify() { $event = new EventTested(); $this->eventDispatcher->expects($this->once())->method('dispatch')->with('disable_event', $event); $this->notifier->expects($this->never())->method('supportsObject')->with($event, 'foo'); $this->notifier->expects($this->never())->method('notify'); $this->notifierProxy->dispatch('disable_event', $event); }
/** * {@inheritDoc} */ public function dispatch($eventName, Event $event = null) { $event = $this->dispatcher->dispatch($eventName, $event); if (!in_array($eventName, $this->disableNotifyEventNames) && $this->notifier->supportsObject($event, $eventName)) { $this->notifier->notify($event, $eventName); } return $event; }