public function testHostAccessors() { $url = new \r8\URL(); $this->assertNull($url->getHost()); $this->assertFalse($url->hostExists()); $this->assertSame($url, $url->setHost("example.com")); $this->assertSame("example.com", $url->getHost()); $this->assertTrue($url->hostExists()); $this->assertSame($url, $url->setHost("")); $this->assertNull($url->getHost()); $this->assertFalse($url->hostExists()); $this->assertSame($url, $url->setHost(".. s ub. . exam!@#ple-domain.com.... ")); $this->assertSame("sub.example-domain.com", $url->getHost()); $this->assertTrue($url->hostExists()); $this->assertSame($url, $url->clearHost()); $this->assertNull($url->getHost()); $this->assertFalse($url->hostExists()); }