Gush\Tests\Helper\GitHelperTest::merges_remote_branch_in_clean_wc PHP Method

merges_remote_branch_in_clean_wc() public method

    public function merges_remote_branch_in_clean_wc()
    {
        $base = 'master';
        $sourceBranch = 'amazing-feature';
        $tmpName = $this->realFsHelper->newTempFilename();
        $hash = '8ae59958a2632018275b8db9590e9a79331030cb';
        $message = "Black-box testing 123\n\n\nAah!";
        $processHelper = $this->prophesize(ProcessHelper::class);
        $this->unitGit = new GitHelper($processHelper->reveal(), $this->gitConfigHelper->reveal(), $this->filesystemHelper->reveal());
        $this->filesystemHelper->newTempFilename()->willReturn($tmpName);
        $processHelper->runCommand('git status --porcelain --untracked-files=no')->willReturn("\n");
        $processHelper->runCommand('git rev-parse --abbrev-ref HEAD')->willReturn('master');
        $processHelper->runCommand(['git', 'checkout', 'master'])->shouldBeCalled();
        $processHelper->runCommands([['line' => ['git', 'merge', '--no-ff', '--no-commit', '--no-log', 'amazing-feature'], 'allow_failures' => false], ['line' => ['git', 'commit', '-F', $tmpName], 'allow_failures' => false]])->shouldBeCalled();
        $processHelper->runCommand('git rev-parse HEAD')->willReturn($hash);
        $this->assertEquals($hash, $this->unitGit->mergeBranch($base, $sourceBranch, $message));
    }