getHost() public method

Hostname (without port information) e.g. example.org
public getHost ( ) : string
return string
Beispiel #1
0
 public function testExceptionsThrown()
 {
     $url = new Http\Url('/');
     try {
         $url->getScheme();
         $this->fail('getScheme() should throw exception');
     } catch (Http\UrlException $e) {
         $this->assertTrue(true);
     }
     try {
         $url->getHost();
         $this->fail('getHost() should throw exception');
     } catch (Http\UrlException $e) {
         $this->assertTrue(true);
     }
 }