Webmozart\Console\ConsoleApplication::hasCommand PHP Method

hasCommand() public method

public hasCommand ( $name )
    public function hasCommand($name)
    {
        return $this->commands->contains($name);
    }

Usage Example

 public function testHasCommand()
 {
     $this->config->addCommandConfig($config = new CommandConfig('command'));
     $application = new ConsoleApplication($this->config);
     $this->assertTrue($application->hasCommand('command'));
     $this->assertFalse($application->hasCommand('foobar'));
 }