Exemplo n.º 1
0
 public function testGetAuthority()
 {
     //If no authority information is present, this method MUST return an empty
     //string.
     $uri = new Uri('/abc/def');
     $this->assertSame('', $uri->getAuthority());
     // The authority syntax of the URI is:
     //<pre>
     //[user-info@]host[:port]
     //</pre>
     $uri = new Uri('http://blog.wani.kr');
     $this->assertSame('blog.wani.kr', $uri->getAuthority());
     $uri = new Uri('http://wan2land@blog.wani.kr');
     $this->assertSame('*****@*****.**', $uri->getAuthority());
     $uri = new Uri('http://wan2land@blog.wani.kr:8080');
     $this->assertSame('wan2land@blog.wani.kr:8080', $uri->getAuthority());
     // If the port component is not set or is the standard port for the current
     // scheme, it SHOULD NOT be included.
     $uri = new Uri('http://wan2land@blog.wani.kr:80');
     $this->assertSame('*****@*****.**', $uri->getAuthority());
 }