protected function execute(InputInterface $input, OutputInterface $output) { $parser = new PHPInputParser($input); $runner = new Runner($parser, $this->fileSystem, new Executor()); $runner->run($input->getArgument('template')); $output->writeln("Command run successfully"); }
public function testRunnerWithDummyParser() { $parser = Doubles::fromClass(PHPInputParser::FQCN); $parser->stub('getRunnerParams', array('dummyPath' => 'src/DummyFile.php')); $parser->mock('prepareCompiler', function ($methodName, $arguments) { $arguments[0]->setValue('dummyValue', 'foobar'); }); $runner = new Runner($parser, $this->fileSystem, $this->executor); $runner->run('dummy'); $contents = file_get_contents($this->tempFixturePath . '/src/DummyFile.php'); $this->assertSame('foobar', trim($contents)); }