Matthias\SymfonyConsoleForm\Tests\Helper\ApplicationTester::run PHP Метод

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

public run ( $input, array $options = [] )
$options array
    public function run($input, array $options = [])
    {
        if (isset($options['interactive']) && $options['interactive']) {
            $this->input = new InteractiveStringInput($input);
        } else {
            $this->input = new StringInput($input);
            $this->input->setInteractive(false);
        }
        $this->output = new StreamOutput(fopen('php://memory', 'w', false), OutputInterface::VERBOSITY_DEBUG, false);
        $this->output->setDecorated(false);
        $inputStream = $this->getInputStream();
        rewind($inputStream);
        $this->setInputStream($inputStream);
        $this->application->setAutoExit(false);
        $this->disableStty();
        $this->statusCode = $this->application->run($this->input, $this->output);
        return $this->statusCode;
    }

Usage Example

Пример #1
0
 private function runCommandWithNonInteractiveInput($name)
 {
     $this->tester->run($name, array('interactive' => false, 'decorated' => false));
 }