withFragment() public method

public withFragment ( $fragment )
示例#1
0
文件: UriTest.php 项目: phly/http
 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);
 }