Beispiel #1
0
 public function testGetQuery()
 {
     // If no query string is present, this method MUST return an empty string.
     $uri = new Uri('http://blog.wani.kr');
     $this->assertSame('', $uri->getQuery());
     // The leading "?" character is not part of the query and MUST NOT be
     // added.
     $uri = new Uri('http://blog.wani.kr?hello=world&abc=def');
     $this->assertSame('hello=world&abc=def', $uri->getQuery());
     // 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.4.
     // As an example, if a value in a key/value pair of the query string should
     // include an ampersand ("&") not intended as a delimiter between values,
     // that value MUST be passed in encoded form (e.g., "%26") to the instance.
     $uri = new Uri('http://blog.wani.kr?hello=world&한글=def');
     $this->assertSame('hello=world&%ED%95%9C%EA%B8%80=def', $uri->getQuery());
 }