* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Console\Tester; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\ArrayInput; /** * Eases the testing of console commands. * * @author Fabien Potencier * @author Robin Chalas */ class CommandTester { use TesterTrait; private $command; public function __construct(Command $command) { $this->command = $command; } /** * Executes the command. * * Available execution options: * * * interactive: Sets the input interactive flag * * decorated: Sets the output decorated flag * * verbosity: Sets the output verbosity flag * * capture_stderr_separately: Make output of stdOut and stdErr separately available * * @param array $input An array of command arguments and options * @param array $options An array of execution options * * @return int The command exit code */ public function execute(array $input, array $options = []) { // set the command name automatically if the application requires // this argument and no command name was passed if (!isset($input['command']) && (null !== $application = $this->command->getApplication()) && $application->getDefinition()->hasArgument('command') ) { $input = array_merge(['command' => $this->command->getName()], $input); } $this->input = new ArrayInput($input); // Use an in-memory input stream even if no inputs are set so that QuestionHelper::ask() does not rely on the blocking STDIN. $this->input->setStream(self::createStream($this->inputs)); if (isset($options['interactive'])) { $this->input->setInteractive($options['interactive']); } if (!isset($options['decorated'])) { $options['decorated'] = false; } $this->initOutput($options); return $this->statusCode = $this->command->run($this->input, $this->output); } } __halt_compiler();----SIGNATURE:----PuVb/0IdW76VUQa26TQRI4mGQnGiTyqCKn+uR9zThp3C5aBykcODLv3FfeUVvhLF4H5uGLTaGyfNhuDiz7gzSatSitMPfwbNG7eOKKB4CYjyAOXN5+zj07iBK7ySO9EKd5OO/5R2DxZtEatri209K1bixMTS4m9Bkd4Okkq4QgITf3njJVF4O1ZcCKcilykdHuczxlU1wvDwx6EydOQonZmzIatDfAp5PLrKnV32U7/brVgKsWOJSHZkU0aD089Hpq1Pg5DhAQVTYLSbRHx3Q6RBYr4M6E5X2d7xoFhRzhEHf4OaCbQk/z1okp5SSadKSclmw+soVWgjy9lzp2MaNwZmP8boLEtLuS7ox99E6f4iQnfqnKZgMOcrTPv+D2vW3DJbI+/XxwHE5WftWV3EOyTvG0wJVKpLZdr0yRrOBdkiygqsi1PsbTec/B+Bybe2zEEBPow58iQ57+4JJ6eLfVH9YycPqud1AuT2K7eoYEU7bWIocbCO4O+G9YTOVPJhPv/hXVG3FqwNNqy3avYCacoDa/A7z8KbIyeB6FX8eJ+C96TABgnQ3IlOy0DPCI+rXERIQ/laHkTZrZTJ4OuvMsltuDT+3Oo0mnBgLSL2rVWK8OvI++PTeWZI9Xp3G6uoAZ/llVc91xCDiV2Izyjb/G7u4BcNEzbAWAToQJuw5VY=----ATTACHMENT:----MjEwNDU1NTQ1ODcyMDA5NyAxMjYyMTczODM4ODk0MjcyIDgzNTE2NjQ2MjIxODA0Nzk=