addCommandConfig() public method

Adds a command configuration to the application.
See also: beginCommand()
public addCommandConfig ( CommandConfig $config ) : static
$config CommandConfig The command configuration.
return static The current instance.
Ejemplo n.º 1
0
 public function testHasCommandConfigs()
 {
     $this->assertFalse($this->config->hasCommandConfigs());
     $this->config->addCommandConfig($config = new CommandConfig());
     $this->assertTrue($this->config->hasCommandConfigs());
 }
Ejemplo n.º 2
0
 /**
  * @expectedException \Webmozart\Console\Api\Command\CannotAddCommandException
  */
 public function testFailIfDuplicateCommandName()
 {
     $this->config->addCommandConfig(new CommandConfig('command'));
     $this->config->addCommandConfig(new CommandConfig('command'));
     new ConsoleApplication($this->config);
 }