/** * Sets the Host * * @param String $host The host being set * @return \r8\URL Returns a self reference */ public function setHost($host) { $host = (string) $host; $host = preg_replace("/[^a-z0-9\\.\\-]/i", "", $host); $host = \r8\str\stripRepeats($host, "."); $host = trim($host, "."); $this->host = empty($host) ? null : $host; return $this; }
public function testStripRepeats_Exception() { $this->setExpectedException('\\r8\\Exception\\Argument'); \r8\str\stripRepeats('Stringy string with multiple occurances of the word string', ''); }