/** * @param string $branch * @return bool */ public function hasRemoteBranch($branch) { $output = $this->run('show-branch', ['--list', '-r']); // $output = $this->run('ls-remote', []); //super slow $branches = GitOutputHelper::extractRemoteBranches($output); $result = in_array($branch, $branches); return $result; }
/** * @param string $pattern * @param array $expected * * @dataProvider dataProviderTestExtractRemoteBranches2 */ public function testExtractRemoteBranches2($pattern, $expected) { $actual = GitOutputHelper::extractRemoteBranches2($pattern); $this->assertEquals($actual, $expected); }