Gush\Tests\Command\CommandTestCase::getCommandTester PHP Method

getCommandTester() protected method

protected getCommandTester ( Command $command, array $systemConfig = null, array $localConfig = null, Closure | null $helperSetManipulator = null ) : Gush\Tests\Command\CommandTester
$command Symfony\Component\Console\Command\Command
$systemConfig array
$localConfig array
$helperSetManipulator Closure | null
return Gush\Tests\Command\CommandTester
    protected function getCommandTester(Command $command, array $systemConfig = null, array $localConfig = null, $helperSetManipulator = null)
    {
        if (null === $systemConfig) {
            $systemConfig = ['adapters' => ['github_enterprise' => ['authentication' => ['username' => 'cordoval', 'password' => 'very-un-secret']]]];
        }
        if (null === $localConfig) {
            $localConfig = self::$localConfig;
        }
        if ($this->requiresRealConfigDir()) {
            $config = new Config($this->getNewTmpDirectory('home'), $systemConfig, $this->getNewTmpDirectory('repo-dir'), $localConfig);
        } else {
            try {
                // Note. The paths must be invalid to always trigger the exception
                $config = new Config(':?/temp/user', $systemConfig, ':?/temp/repo-dir', $localConfig);
            } catch (IOException $e) {
                echo sprintf("Test-class \"%s\" seems to use the filesystem! \nOverwrite requiresRealConfigDir() with 'return " . "true;' to enable the Configuration filesystem usage.", get_class($this));
                throw $e;
            }
        }
        $application = $this->getApplication($config, $helperSetManipulator);
        $command->setApplication($application);
        return new CommandTester($command);
    }