public function testOutput() { $app = new Application(new Config(array('adapter' => 'cli'))); $app->add(new DummyCommand()); $app->setAutoExit(false); $output = new BufferedOutput(); $code = $app->run(new StringInput("dummy -vvv"), $output); $this->assertSame(42, $code); }
public function runCommand($cmd) { $app = new Application(new Config(array('adapter' => 'cli'))); $app->setAutoExit(false); $input = new StringInput($cmd); $output = new BufferedOutput(); $app->run($input, $output); return $output->fetch(); }