public function testHost() { $_SERVER['HTTP_HOST'] = ''; $_SERVER['SERVER_NAME'] = 'domain.com'; $_SERVER['SERVER_PORT'] = '8443'; $r = new Request(); $this->assertEquals('domain.com:8443', $r->getHost()); $_SERVER['HTTP_HOST'] = 'www.domain.com'; $_SERVER['SERVER_NAME'] = 'domain.com'; $_SERVER['SERVER_PORT'] = '80'; $r = new Request(); $this->assertEquals('www.domain.com', $r->getHost()); }