/** * @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; }
/** * 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; }