diff --git a/php-packages/testing/tests/integration/ConsoleTestCase.php b/php-packages/testing/tests/integration/ConsoleTestCase.php new file mode 100644 index 000000000..80d907a2e --- /dev/null +++ b/php-packages/testing/tests/integration/ConsoleTestCase.php @@ -0,0 +1,44 @@ +console)) { + $this->console = new ConsoleApplication('Flarum', Application::VERSION); + $this->console->setAutoExit(false); + + foreach ($this->app()->getConsoleCommands() as $command) { + $this->console->add($command); + } + } + + return $this->console; + } + + protected function runCommand(array $inputArray) + { + $input = new ArrayInput($inputArray); + $output = new BufferedOutput(); + + $this->console()->run($input, $output); + + return trim($output->fetch()); + } +}