Пример #1
0
 public function testMergeCommit()
 {
     $commitdata = array('abbrevhash', 'treehash', array('parent1', 'parent2'), 'author <authoremail>', '12345678', '-0500', 'committer <committeremail>', '87654321', '-0600', 'commit line 1 commit line 1 commit line 1 commit line 1', array('commit line 1 commit line 1 commit line 1 commit line 1', 'commit line 2'));
     $loadstrategy = $this->getMock('GitPHP_CommitLoadStrategy_Interface');
     $loadstrategy->expects($this->once())->method('Load')->with($this->isInstanceOf('GitPHP_Commit'))->will($this->returnValue($commitdata));
     $commit = new GitPHP_Commit($this->getMockBuilder('GitPHP_Project')->disableOriginalConstructor()->getMock(), '1234567890abcdef1234567890ABCDEF12345678', $loadstrategy);
     $this->assertTrue($commit->IsMergeCommit());
     $this->assertTrue($commit->IsMergeCommit());
     //cached
     $commitdata = array('abbrevhash', 'treehash', array('parent1'), 'author <authoremail>', '12345678', '-0500', 'committer <committeremail>', '87654321', '-0600', 'commit line 1 commit line 1 commit line 1 commit line 1', array('commit line 1 commit line 1 commit line 1 commit line 1', 'commit line 2'));
     $loadstrategy = $this->getMock('GitPHP_CommitLoadStrategy_Interface');
     $loadstrategy->expects($this->once())->method('Load')->with($this->isInstanceOf('GitPHP_Commit'))->will($this->returnValue($commitdata));
     $commit = new GitPHP_Commit($this->getMockBuilder('GitPHP_Project')->disableOriginalConstructor()->getMock(), '1234567890abcdef1234567890ABCDEF12345678', $loadstrategy);
     $this->assertFalse($commit->IsMergeCommit());
     $this->assertFalse($commit->IsMergeCommit());
     //cached
 }