Ejemplo n.º 1
0
 /**
  * Tests setConnection().
  */
 public function testSetConnection()
 {
     $connection = $this->getMock('\\Phergie\\Irc\\ConnectionInterface', array(), array(), '', false);
     $this->event->setConnection($connection);
     $this->assertSame($connection, $this->event->getConnection());
 }
 /**
  * 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']);
 }