Example #1
0
 /**
  * Tests setCommand().
  */
 public function testSetCommand()
 {
     $command = 'COMMAND';
     $this->event->setCommand($command);
     $this->assertSame($command, $this->event->getCommand());
 }
 /**
  * Primes an Event object with data.
  *
  * @param \Phergie\Irc\Event\Event $event
  */
 protected function initializeEvent(Event $event)
 {
     $connection = Phake::mock('\\Phergie\\Irc\\ConnectionInterface');
     Phake::when($connection)->getServerHostname()->thenReturn($this->connection['serverHostname']);
     Phake::when($connection)->getServerPort()->thenReturn($this->connection['serverPort']);
     Phake::when($connection)->getNickname()->thenReturn($this->connection['nickname']);
     Phake::when($connection)->getUsername()->thenReturn($this->connection['username']);
     Phake::when($connection)->getHostname()->thenReturn($this->connection['hostname']);
     Phake::when($connection)->getServername()->thenReturn($this->connection['servername']);
     Phake::when($connection)->getRealname()->thenReturn($this->connection['realname']);
     $event->setConnection($connection);
     $event->setCommand($this->event['command']);
     $event->setParams($this->event['params']);
     $event->setMessage($this->event['message']);
 }