Beispiel #1
0
 public function testGetFragment()
 {
     // If no fragment is present, this method MUST return an empty string.
     $uri = new Uri('http://blog.wani.kr');
     $this->assertSame('', $uri->getFragment());
     // The leading "#" character is not part of the fragment and MUST NOT be
     // added.
     $uri = new Uri('http://blog.wani.kr#helloworld');
     $this->assertSame('helloworld', $uri->getFragment());
     // The value returned MUST be percent-encoded, but MUST NOT double-encode
     // any characters. To determine what characters to encode, please refer to
     // RFC 3986, Sections 2 and 3.5.
     $uri = new Uri('http://blog.wani.kr#한글은한글은');
     $this->assertSame('%ED%95%9C%EA%B8%80%EC%9D%80%ED%95%9C%EA%B8%80%EC%9D%80', $uri->getFragment());
 }