branchExists() public method

public branchExists ( string $branch ) : boolean
$branch string
return boolean
Example #1
0
    public function testBranchExistsException()
    {
        $sourceBranch = 'my-feat-10';
        $list = <<<'EOL'
  my-feat-10
  my-feat-10
EOL;
        $processHelper = $this->prophesize(ProcessHelper::class);
        $this->unitGit = new GitHelper($processHelper->reveal(), $this->gitConfigHelper->reveal(), $this->filesystemHelper->reveal());
        $processHelper->runCommand(['git', 'branch', '--list', $sourceBranch], true)->willReturn($list);
        $this->setExpectedException('\\RuntimeException', sprintf('Invalid list of local branches found while searching for "%s"', $sourceBranch));
        $this->assertTrue($this->unitGit->branchExists($sourceBranch));
    }