Webmozart\Console\ConsoleApplication::getCommands PHP Method

getCommands() public method

public getCommands ( )
    public function getCommands()
    {
        return clone $this->commands;
    }

Usage Example

 public function testGetCommandsExcludesDisabledCommands()
 {
     $this->config->addCommandConfig($enabled = CommandConfig::create('command1')->enable());
     $this->config->addCommandConfig($disabled = CommandConfig::create('command2')->disable());
     $application = new ConsoleApplication($this->config);
     $this->assertEquals(new CommandCollection(array(new Command($enabled, $application))), $application->getCommands());
 }