/** * Runs the instantiated Terminus application * * @param InputInterface $input An input object to run the application with * @param OutputInterface $output An output object to run the application with * @return integer $status_code The exiting status code of the application */ public function run(InputInterface $input, OutputInterface $output) { if (!empty($cassette = $this->config->get('vcr_cassette')) && !empty($mode = $this->config->get('vcr_mode'))) { $this->startVCR(array_merge(compact('cassette'), compact('mode'))); } $status_code = $this->runner->run($input, $output, null, $this->commands); if (!empty($cassette) && !empty($mode)) { $this->stopVCR(); } return $status_code; }
public function testInitCommand() { $container = \Robo\Robo::getContainer(); $app = $container->get('application'); $app->addInitRoboFileCommand(getcwd() . '/testRoboFile.php', 'RoboTestClass'); $argv = ['placeholder', 'init']; $status = $this->runner->run($argv, $this->guy->capturedOutputStream(), $app); $this->guy->seeInOutput('testRoboFile.php will be created in the current directory'); $this->assertEquals(0, $status); $this->assertTrue(file_exists('testRoboFile.php')); $commandContents = file_get_contents('testRoboFile.php'); unlink('testRoboFile.php'); $this->assertContains('class RoboTestClass', $commandContents); }