Exemple #1
0
 public function testAllowsToDefineDefaultValues()
 {
     $this->application->command('greet [firstname] [lastname]', function ($firstname, $lastname, Outputinterface $output) {
     });
     $this->application->defaults('greet', ['firstname' => 'John', 'lastname' => 'Doe']);
     $definition = $this->application->get('greet')->getDefinition();
     $this->assertEquals('John', $definition->getArgument('firstname')->getDefault());
     $this->assertEquals('Doe', $definition->getArgument('lastname')->getDefault());
 }
 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");
 }