/** * Extends the list of known options. Takes the same argument types as the constructor. * * @param mixed $options * @throws \InvalidArgumentException */ public function addOptions($options) { if (is_string($options)) { $this->mergeOptions($this->optionParser->parseString($options)); } elseif (is_array($options)) { $this->mergeOptions($this->optionParser->parseArray($options)); } else { throw new \InvalidArgumentException("Getopt(): argument must be string or array"); } }
public function testParseStringTripleColon() { $this->setExpectedException('InvalidArgumentException'); $this->parser->parseString('ab:c:::d'); }