Exemple #1
0
 /**
  * {@inheritdoc}
  *
  * @see \Satooshi\Bundle\CoverallsBundle\Entity\ArrayConvertable::toArray()
  */
 public function toArray()
 {
     $remotes = array();
     foreach ($this->remotes as $remote) {
         $remotes[] = $remote->toArray();
     }
     return array('branch' => $this->branch, 'head' => $this->head->toArray(), 'remotes' => $remotes);
 }
 /**
  * Collect commit info.
  *
  * @return \Satooshi\Bundle\CoverallsV1Bundle\Entity\Git\Commit
  *
  * @throws \RuntimeException
  */
 protected function collectCommit()
 {
     $commitResult = $this->command->getHeadCommit();
     if (count($commitResult) !== 6 || array_keys($commitResult) !== range(0, 5)) {
         throw new \RuntimeException();
     }
     $commit = new Commit();
     return $commit->setId($commitResult[0])->setAuthorName($commitResult[1])->setAuthorEmail($commitResult[2])->setCommitterName($commitResult[3])->setCommitterEmail($commitResult[4])->setMessage($commitResult[5]);
 }
 protected function assertCommit(Commit $commit)
 {
     $this->assertEquals('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', $commit->getId());
     $this->assertEquals('Author Name', $commit->getAuthorName());
     $this->assertEquals('*****@*****.**', $commit->getAuthorEmail());
     $this->assertEquals('Committer Name', $commit->getCommitterName());
     $this->assertEquals('*****@*****.**', $commit->getCommitterEmail());
     $this->assertEquals('commit message', $commit->getMessage());
 }