withQuery() public method

public withQuery ( $query )
Beispiel #1
0
 public function testStripsQueryPrefixIfPresent()
 {
     $uri = new Uri('http://example.com');
     $new = $uri->withQuery('?foo=bar');
     $this->assertEquals('foo=bar', $new->getQuery());
 }
Beispiel #2
0
 /**
  * @group 48
  */
 public function testWithQueryReturnsSameInstanceWhenQueryDoesNotChange()
 {
     $uri = new Uri('http://example.com/test/path?foo=bar');
     $test = $uri->withQuery('foo=bar');
     $this->assertSame($uri, $test);
 }