/** * Returns the channel name if the event occurred in a channel or the * user nick if the event was a private message directed at the bot by a * user. * * @return string */ public function getSource() { if (substr($this->arguments[0], 0, 1) == '#') { return $this->arguments[0]; } return $this->hostmask->getNick(); }
/** * Tests setNick() function for correctly setting nick property. * * @return void */ public function testSetNick() { $this->hostmask->setNick('newnickname'); $this->assertEquals('newnickname', $this->hostmask->getNick()); }