public function testCommand() { $command = new ClosureCommand('demo', function () { $this->comment('hello'); }); $this->application->add($command); $this->assertSame($command, $this->application->get('demo')); $this->assertOutputIs('demo', 'hello' . "\n"); }
public static function createCerebro(ContainerInterface $container) : Application { $console = new Application($container, $container->get(DispatcherContract::class), self::getConfig($container, 'version'), self::getConfig($container, 'name', 'Cerebro')); // Add auto-complete for Symfony Console application $console->add(new CompletionCommand()); return $console; }
public function testAllowsToDefineViserioCommand() { $viserioCommand = new ViserioCommand(); $command = $this->application->add($viserioCommand); $this->assertSame($command, $this->application->get('demo:greet')); }