withPath() 공개 메소드

public withPath ( $path )
예제 #1
0
파일: UriTest.php 프로젝트: easySuite/ding2
 /**
  * @group 48
  */
 public function testWithPathReturnsSameInstanceWhenPathDoesNotChange()
 {
     $uri = new Uri('http://example.com/test/path');
     $test = $uri->withPath('/test/path');
     $this->assertSame($uri, $test);
 }
예제 #2
0
파일: UriTest.php 프로젝트: phly/http
 public function testPathNotSlashPrefixedIsEmittedWithSlashDelimiterWhenUriIsCastToString()
 {
     $uri = new Uri('http://example.com');
     $new = $uri->withPath('foo/bar');
     $this->assertEquals('http://example.com/foo/bar', $new->__toString());
 }
예제 #3
0
 public function testPathIsPrefixedWithSlashIfSetWithoutOne()
 {
     $uri = new Uri('http://example.com');
     $new = $uri->withPath('foo/bar');
     $this->assertEquals('/foo/bar', $new->getPath());
 }