/** * Create Command. * * @param string $expression * @param callable $callable * * @return \Symfony\Component\Console\Command\Command */ protected function createCommand(string $expression, callable $callable) : SymfonyCommand { $result = $this->expressionParser->parse($expression); $command = new SymfonyCommand($result['name']); $command->getDefinition()->addArguments($result['arguments']); $command->getDefinition()->addOptions($result['options']); $command->setCode($callable); return $command; }
public function assertParsesTo($expression, $expected) { $parser = new ExpressionParser(); $this->assertEquals($expected, $parser->parse($expression)); }