/**
  * Checks that user event data has been converted.
  *
  * @param array $data
  * @param \Phergie\Irc\Event\UserEvent $event
  */
 protected function checkUserEventData(array $data, UserEvent $event)
 {
     $this->assertSame($data['prefix'], $event->getPrefix());
     $this->assertSame($data['nick'], $event->getNick());
     $this->assertSame($data['user'], $event->getUsername());
     $this->assertSame($data['host'], $event->getHost());
     $this->assertSame($data['message'], $event->getMessage());
     $this->assertSame($data['command'], $event->getCommand());
     $this->assertSame($data['targets'], $event->getTargets());
 }
 public function handleMessage(UserEvent $event, Queue $queue)
 {
     // make sure we don't react twice when the nfo command gets triggered
     if (strpos($event->getMessage(), 'nfo ') === false) {
         if (preg_match_all("/[a-z0-9._]{4,}-[a-z0-9]{3,}/i", $event->getMessage(), $matches)) {
             $matches = array_slice($matches[0], 0, $this->limit);
             foreach ($matches as $dirname) {
                 $commandEvent = new CommandEvent();
                 $commandEvent->fromEvent($event);
                 $commandEvent->setCustomParams(array($dirname));
                 $this->handleNfoCommand($commandEvent, $queue, false);
             }
         }
     }
 }