/**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  *
  * @since  2.0
  *
  */
 protected function setUp()
 {
     $command = new RootCommand('default', new MockIO());
     $command->setApplication(new Console());
     $command->addCommand('yoo', 'yoo desc');
     $command->handler(function ($command) {
         return 123;
     });
     $this->instance = $command;
 }
Example #2
0
 /**
  * Test global.
  *
  * @return void
  *
  * @since  2.0
  */
 public function testGlobal()
 {
     $this->command->addGlobalOption('k', 'default', 'k desc');
     $this->command->addCommand('kkk');
     $kkk = $this->command->getChild('kkk');
     $options = $kkk->getAllOptions();
     $this->assertArrayHasKey('k', $options);
 }