public function testLoadHead()
 {
     $strategy = new GitPHP_ProjectLoad_Raw($this->getMockBuilder('GitPHP_GitObjectLoader')->disableOriginalConstructor()->getMock());
     $project = new GitPHP_Project(GITPHP_TEST_PROJECTROOT, 'testrepo.git');
     $headlistmock = $this->getMock('GitPHP_HeadList', array('Exists', 'GetHead'), array($project, $this->getMock('GitPHP_HeadListLoadStrategy_Interface')));
     $headmock = $this->getMock('GitPHP_Head', array('GetHash'), array($project, 'master'));
     $headmock->expects($this->any())->method('GetHash')->will($this->returnValue('1234567890abcdef1234567890ABCDEF12345678'));
     $headlistmock->expects($this->any())->method('Exists')->with($this->equalTo('master'))->will($this->returnValue(true));
     $headlistmock->expects($this->any())->method('GetHead')->with($this->equalTo('master'))->will($this->returnValue($headmock));
     $project->SetHeadList($headlistmock);
     $this->assertEquals('1234567890abcdef1234567890ABCDEF12345678', $strategy->LoadHead($project));
     $project = new GitPHP_Project(GITPHP_TEST_PROJECTROOT, 'testrepoexported.git');
     $this->assertEquals('1234567890abcdef1234567890ABCDEF12345678', $strategy->LoadHead($project));
 }
 /**
  * Inject project dependency objects
  *
  * @param GitPHP_Project $project project object
  */
 protected function InjectProjectDependencies($project)
 {
     if (!$project) {
         return;
     }
     $compat = $project->GetCompat();
     $loader = null;
     if ($compat) {
         $project->SetStrategy(new GitPHP_ProjectLoad_Git($this->exe));
     } else {
         $loader = new GitPHP_GitObjectLoader($project);
         $project->SetStrategy(new GitPHP_ProjectLoad_Raw($loader));
     }
     $headListStrategy = null;
     if ($compat) {
         $headListStrategy = new GitPHP_HeadListLoad_Git($this->exe);
     } else {
         $headListStrategy = new GitPHP_HeadListLoad_Raw();
     }
     $headList = new GitPHP_HeadList($project, $headListStrategy);
     $project->SetHeadList($headList);
     $tagListStrategy = null;
     if ($compat) {
         $tagListStrategy = new GitPHP_TagListLoad_Git($this->exe);
     } else {
         $tagListStrategy = new GitPHP_TagListLoad_Raw();
     }
     $tagList = new GitPHP_TagList($project, $tagListStrategy);
     $project->SetTagList($tagList);
     $manager = new GitPHP_GitObjectManager($project);
     $manager->SetCompat($compat);
     if (!$compat) {
         $manager->SetObjectLoader($loader);
     }
     $manager->SetExe($this->exe);
     if ($this->memoryCache) {
         $manager->SetMemoryCache($this->memoryCache);
     }
     if ($this->cache) {
         $manager->SetCache($this->cache);
     }
     $project->SetObjectManager($manager);
 }