public function getCommandConfig($name) { foreach ($this->commandConfigs as $commandConfig) { if ($name === $commandConfig->getName()) { return $commandConfig; } } throw NoSuchCommandException::forCommandName($name); }
/** * @expectedException \Webmozart\Console\Api\Command\NoSuchCommandException */ public function testGetCommandConfigFailsIfCommandNotFound() { $this->config->getCommandConfig('command'); }