Ejemplo n.º 1
0
 /**
  * Logs in to the IRC server with the user info in the config.
  */
 private function login()
 {
     if (isset($this->config['connection_password'])) {
         $this->send(Response::pass($this->config['connection_password']));
     }
     $this->send(Response::nick($this->config['nick']));
     $this->send(Response::user($this->config['username'], $this->config['realname']));
     if (isset($this->config['password'])) {
         $this->send(Response::msg('NickServ', 'IDENTIFY ' . $this->config['password']));
     }
 }
Ejemplo n.º 2
0
 public function testClass()
 {
     $this->string(TestedClass::pong($host = uniqid()))->isEqualTo('PONG :' . $host)->string(TestedClass::quit($message = uniqid()))->isEqualTo('QUIT :' . $message)->string(TestedClass::join($channel = '#' . uniqid()))->isEqualTo('JOIN ' . $channel)->string(TestedClass::leave($channel))->isEqualTo('PART ' . $channel)->string(TestedClass::msg($who = uniqid(), $message))->isEqualTo('PRIVMSG ' . $who . ' :' . $message)->string(TestedClass::notice($channel, $message))->isEqualTo('NOTICE ' . $channel . ' :' . $message)->string(TestedClass::action($channel, $message))->isEqualTo('PRIVMSG ' . $channel . ' :' . "ACTION " . $message . "")->string(TestedClass::user($nick = uniqid(), $name = uniqid()))->isEqualTo('USER ' . $nick . ' 8 * :' . $name)->string(TestedClass::nick($nick))->isEqualTo('NICK :' . $nick)->string(TestedClass::pass($pass = uniqid()))->isEqualTo('PASS ' . $pass);
 }