addSubCommandConfig() public method

Adds configuration for a sub-command.
See also: beginSubCommand()
public addSubCommandConfig ( SubCommandConfig $config ) : static
$config SubCommandConfig The sub-command configuration.
return static The current instance.
示例#1
0
 public function testEditOptionCommand()
 {
     $this->config->addSubCommandConfig($config1 = new OptionCommandConfig('command1', 'a'));
     $this->assertSame($config1, $this->config->editOptionCommand('command1'));
 }
示例#2
0
 /**
  * @expectedException \Webmozart\Console\Api\Command\CannotAddCommandException
  */
 public function testFailIfOptionCommandSameNameAsOptionShort()
 {
     $config = new CommandConfig('command');
     $config->addOption('option1', 'o');
     $config->addSubCommandConfig(new OptionCommandConfig('option2', 'o'));
     new Command($config);
 }