Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 3
0
 public function testAllowsToDefineViserioCommand()
 {
     $viserioCommand = new ViserioCommand();
     $command = $this->application->add($viserioCommand);
     $this->assertSame($command, $this->application->get('demo:greet'));
 }