Joli\GifExceptionBundle\Tests\WebTestCase::getOutputForCommand PHP Méthode

getOutputForCommand() protected méthode

Get the output for a Command.
protected getOutputForCommand ( Command $command, string $commandName, array $args = [], array $options = [] ) : string
$command Symfony\Component\Console\Command\Command The Command to run.
$commandName string
$args array
$options array
Résultat string The output.
    protected function getOutputForCommand($command, $commandName, array $args = array(), array $options = array())
    {
        if (empty($args)) {
            $args = array('command' => $commandName);
        }
        $this->application->add($command);
        $applicationCommand = $this->application->find($commandName);
        $commandTester = new CommandTester($applicationCommand);
        $commandTester->execute($args, $options);
        return $commandTester->getDisplay();
    }