protected function getGitHelper($isGitDir = true, $hasTag = true)
{
$helper = parent::getGitHelper($isGitDir);
$helper->getActiveBranchName()->willReturn('master');
if ($hasTag) {
$helper->getLastTagOnBranch('master')->willReturn(self::TEST_TAG_NAME);
$helper->getLogBetweenCommits(self::TEST_TAG_NAME, 'master')->willReturn([['sha' => '68bfa1d00', 'author' => 'Anonymous <[email protected]>', 'subject' => ' Another hack which fixes #123', 'message' => ' Another hack which fixes #123'], ['sha' => '68bfa1d05', 'author' => 'Anonymous <[email protected]>', 'subject' => ' Another hack which fixes GITHUB-500', 'message' => ' Another hack which fixes GITHUB-500']]);
} else {
$helper->getLastTagOnBranch()->willThrow(new \RuntimeException('fatal: No names found, cannot describe anything.'));
}
return $helper;
}