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

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

    public function testRunCommandWithoutExistingLocalConfigAndNoRemote()
    {
        $command = new InitCommand();
        $tester = $this->getCommandTester($command, ['adapters' => ['github' => ['authentication' => ['http-auth-type' => TestConfigurator::AUTH_HTTP_TOKEN, 'username' => TestConfigurator::USERNAME, 'token' => TestConfigurator::PASSWORD], 'base_url' => 'https://api.github.com/', 'repo_domain_url' => 'https://github.com']]], [], function (HelperSet $helperSet) {
            $helperSet->set($this->getGitConfigHelper(false)->reveal());
        });
        $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("0\n0\nMyOrg\nMyRepo\nIOrg\nIRepo\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', 'issue_tracker' => 'github', 'repo_org' => 'MyOrg', 'repo_name' => 'MyRepo', 'issue_project_org' => 'IOrg', 'issue_project_name' => 'IRepo'];
        $this->assertFileExists($command->getConfig()->get('local_config'));
        $this->assertEquals($expected, $command->getConfig()->toArray(Config::CONFIG_LOCAL));
    }