示例#1
0
 public function testGetSetParser()
 {
     $api = new Api();
     $parser = $api->getParser();
     $this->assertInstanceOf('\\Phergie\\Irc\\Parser', $parser);
     // And set a new one.
     $parser = new \Phergie\Irc\Parser();
     $api->setParser($parser);
     $parserFromApi = $api->getParser();
     $this->assertSame($parser, $parserFromApi);
 }
示例#2
0
 /**
  * @param IrcConnection $ircConnection
  */
 public function setIrcConnection(IrcConnection $ircConnection)
 {
     $this->ircConnection = $ircConnection;
     $this->api->setIrcConnection($ircConnection);
 }
示例#3
0
 /**
  * Disconnect the bot from IRC.
  */
 public function disconnect()
 {
     $this->write($this->api->getGenerator()->ircQuit());
     $this->stream->close();
 }