Gush\Tests\Command\Core\CoreInitCommandTest::testRunCommandWithAutoDetectedOptionsFromGitRemote PHP Метод

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

    public function testRunCommandWithAutoDetectedOptionsFromGitRemote()
    {
        $command = new InitCommand();
        $tester = $this->getCommandTester($command, null, []);
        $this->assertFileNotExists($command->getConfig()->get('local_config'));
        // adapter, issue-tracker, org, repo, issue-org, issue-project
        $helper = $command->getHelper('gush_question');
        $helper->setInputStream($this->getInputStream("\n\n\n\n\n\n"));
        $tester->execute();
        $display = $tester->getDisplay();
        $this->assertCommandOutputMatches(['Choose repository-manager', '[0] GitHub', '[1] GitHub Enterprise', 'Choose issue-tracker', 'Specify the repository organization name', 'Specify the repository name', 'Specify the issue-tracker organization name', 'Specify the issue-tracker repository/project name', ['\\[OK\\]\\sConfiguration file saved successfully\\.$', true]], $display);
        $expected = ['repo_adapter' => 'github_enterprise', 'issue_tracker' => 'github_enterprise', 'repo_org' => 'gushphp', 'repo_name' => 'gush', 'issue_project_org' => 'gushphp', 'issue_project_name' => 'gush'];
        $this->assertFileExists($command->getConfig()->get('local_config'));
        $this->assertEquals($expected, $command->getConfig()->toArray(Config::CONFIG_LOCAL));
    }