Пример #1
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  *
  * @since  1.0
  *
  */
 protected function setUp()
 {
     $command = new RootCommand('default', null, new TestStdout());
     $command->addCommand('yoo', 'yoo desc')->setHandler(function ($command) {
         return 123;
     });
     $this->instance = $command;
 }
Пример #2
0
 /**
  * Test global.
  *
  * @return void
  *
  * @since  1.0
  */
 public function testGlobal()
 {
     $this->command->addOption('k', 'default', 'k desc', Option::IS_GLOBAL)->addCommand('kkk');
     $kkk = $this->command->getChild('kkk');
     $options = $kkk->getAllOptions();
     $this->assertArrayHasKey('k', $options);
 }