public function hasSubCommandConfig($name) { foreach ($this->subCommandConfigs as $commandConfig) { if ($name === $commandConfig->getName()) { return true; } } return false; }
public function testHasSubCommandConfig() { $this->config->addSubCommandConfig($config = new SubCommandConfig()); $this->assertFalse($this->config->hasSubCommandConfig('command')); $this->assertFalse($this->config->hasSubCommandConfig('foobar')); $config->setName('command'); $this->assertTrue($this->config->hasSubCommandConfig('command')); $this->assertFalse($this->config->hasSubCommandConfig('foobar')); }