withQuery() public method

public withQuery ( $query )
コード例 #1
0
ファイル: UriTest.php プロジェクト: phly/http
 public function testStripsQueryPrefixIfPresent()
 {
     $uri = new Uri('http://example.com');
     $new = $uri->withQuery('?foo=bar');
     $this->assertEquals('foo=bar', $new->getQuery());
 }
コード例 #2
0
ファイル: UriTest.php プロジェクト: easySuite/ding2
 /**
  * @group 48
  */
 public function testWithQueryReturnsSameInstanceWhenQueryDoesNotChange()
 {
     $uri = new Uri('http://example.com/test/path?foo=bar');
     $test = $uri->withQuery('foo=bar');
     $this->assertSame($uri, $test);
 }