public function handleDaddyMessage(Event $event, EventQueue $queue) { if ($event instanceof UserEvent) { $nick = $event->getNick(); $channel = $event->getSource(); $params = $event->getParams(); $text = $params['text']; $matched = preg_match("/\\s*who'?s (?:your|ya) ([^?]+)[?]?/i", $text, $matches); if ($matched) { $msg = "You're my " . $matches[1] . ', ' . $nick . '!'; $queue->ircPrivmsg($channel, $msg); } } }
/** * Tests setParams(). */ public function testSetParams() { $params = array('foo' => 'bar'); $this->event->setParams($params); $this->assertSame($params, $this->event->getParams()); }