コード例 #1
0
ファイル: GitTest.php プロジェクト: ggioffreda/git
 /**
  * @covers ::flow
  * @covers \Gioffreda\Component\Git\GitFlow::init
  * @covers \Gioffreda\Component\Git\GitFlow::output
  */
 public function testInitializingGitFLow()
 {
     try {
         self::$git->run(['flow']);
     } catch (GitProcessException $gpe) {
         // if git flow is not installed, don't run this test
         return false;
     }
     $this->assertContains('master', self::$git->flow()->init()->output());
     $this->assertContains('develop', self::$git->flow()->output());
     $this->assertContains('feature/', self::$git->flow()->output());
     $this->assertContains('release/', self::$git->flow()->output());
     $this->assertContains('hotfix/', self::$git->flow()->output());
     $this->assertContains('support/', self::$git->flow()->output());
     // clearing test branches
     foreach ($this->branchesProvider() as $branch) {
         try {
             self::$git->branchDelete($branch[0]);
         } catch (GitException $e) {
             // do nothing
         }
     }
     return true;
 }
コード例 #2
0
ファイル: Git.php プロジェクト: ggioffreda/git
 /**
  * Clone provided remote repository in a local Git project using the specified executable.
  *
  * @param $remote
  * @param $path
  * @param string $gitBin
  * @return Git
  */
 public static function cloneRemote($remote, $path, $gitBin = self::GIT_BIN)
 {
     $git = new Git($path, $gitBin);
     $git->run(['clone', $remote, '.']);
     return $git;
 }