Gush\Tests\Command\PullRequest\PullRequestCreateCommandTest::getLocalGitHelper PHP Method

getLocalGitHelper() private method

private getLocalGitHelper ( $sourceOrg = 'cordoval', $sourceRepo = 'gush', $branch = 'issue-145', $commitCount = 1, $baseBranch = 'master' )
    private function getLocalGitHelper($sourceOrg = 'cordoval', $sourceRepo = 'gush', $branch = 'issue-145', $commitCount = 1, $baseBranch = 'master')
    {
        $helper = $this->getGitHelper();
        $helper->getFirstCommitTitle(sprintf('gushphp/%s', $baseBranch), 'issue-145')->willReturn('Some good title');
        $helper->getActiveBranchName()->willReturn('issue-145');
        $helper->getCommitCountBetweenLocalAndBase(Argument::any(), $baseBranch, Argument::any())->willReturn($commitCount);
        $helper->remoteBranchExists(Argument::any(), Argument::any())->willReturn(false);
        $helper->remoteBranchExists('[email protected]:cordoval/gush.git', $branch)->willReturn(true);
        $helper->remoteUpdate('gushphp')->shouldBeCalled();
        $helper->branchExists(Argument::any())->willReturn(false);
        $helper->branchExists($branch)->will(function () use($helper, $sourceOrg, $sourceRepo, $branch) {
            $helper->remoteUpdate($sourceOrg)->shouldBeCalled();
            $helper->pushToRemote($sourceOrg, $branch, true)->shouldBeCalled();
            return true;
        });
        return $helper;
    }