Gush\Tests\Command\PullRequest\PullRequestMergeCommandTest::testMergePullRequestWithOptionPat PHP Метод

testMergePullRequestWithOptionPat() публичный Метод

    public function testMergePullRequestWithOptionPat()
    {
        $prAuthor = 'weaverryan';
        $command = new PullRequestMergeCommand();
        $tester = $this->getCommandTester($command, null, null, function (HelperSet $helperSet) {
            $helperSet->set($this->getLocalGitHelper(sprintf($this->mergeMessage, 'merge', 10))->reveal());
        });
        $tester->execute(['pr_number' => 10, '--pat' => 'thank_you'], ['interactive' => false]);
        $this->assertCommandOutputMatches([self::COMMAND_DISPLAY, self::COMMAND_DISPLAY_TARGET, sprintf(self::COMMAND_DISPLAY_PAT_GIVEN, $prAuthor, 10)], $tester->getDisplay());
        $this->assertSame(sprintf(self::MERGE_NOTE_PAT_THANK_YOU, $prAuthor), $command->getAdapter()->getComments(2)['body']);
        $tester->execute(['pr_number' => 10, '--pat' => 'random'], ['interactive' => false]);
        $this->assertCommandOutputMatches([self::COMMAND_DISPLAY, self::COMMAND_DISPLAY_TARGET, sprintf(self::COMMAND_DISPLAY_PAT_GIVEN, $prAuthor, 10)], $tester->getDisplay());
        $this->assertContains('@' . $prAuthor, $command->getAdapter()->getComments(2)['body']);
    }