예제 #1
0
 public function testGetAuthorEpoch()
 {
     $commit = new GitPHP_Commit($this->getMockBuilder('GitPHP_Project')->disableOriginalConstructor()->getMock(), '1234567890abcdef1234567890ABCDEF12345678', $this->getMockCommitLoader());
     $this->assertEquals('12345678', $commit->GetAuthorEpoch());
     $this->assertEquals('12345678', $commit->GetAuthorEpoch());
     //cached
 }
예제 #2
0
 /**
  * Compares two commits by author epoch
  *
  * @param GitPHP_Commit $a first commit
  * @param GitPHP_Commit $b second commit
  * @return integer comparison result
  */
 public static function CompareAuthorEpoch($a, $b)
 {
     if ($a->GetAuthorEpoch() === $b->GetAuthorEpoch()) {
         return 0;
     }
     return $a->GetAuthorEpoch() < $b->GetAuthorEpoch() ? -1 : 1;
 }