withFragment() публичный Метод

public withFragment ( $fragment )
Пример #1
0
 public function testStripsFragmentPrefixIfPresent()
 {
     $uri = new Uri('http://example.com');
     $new = $uri->withFragment('#/foo/bar');
     $this->assertEquals('/foo/bar', $new->getFragment());
 }
Пример #2
0
 /**
  * @group 48
  */
 public function testWithFragmentReturnsSameInstanceWhenFragmentDoesNotChange()
 {
     $uri = new Uri('http://example.com/test/path?foo=bar#/baz/bat');
     $test = $uri->withFragment('/baz/bat');
     $this->assertSame($uri, $test);
 }