withPath() public method

public withPath ( $path )
Exemplo n.º 1
0
 /**
  * @group 48
  */
 public function testWithPathReturnsSameInstanceWhenPathDoesNotChange()
 {
     $uri = new Uri('http://example.com/test/path');
     $test = $uri->withPath('/test/path');
     $this->assertSame($uri, $test);
 }
Exemplo n.º 2
0
 public function testPathNotSlashPrefixedIsEmittedWithSlashDelimiterWhenUriIsCastToString()
 {
     $uri = new Uri('http://example.com');
     $new = $uri->withPath('foo/bar');
     $this->assertEquals('http://example.com/foo/bar', $new->__toString());
 }
Exemplo n.º 3
0
 public function testPathIsPrefixedWithSlashIfSetWithoutOne()
 {
     $uri = new Uri('http://example.com');
     $new = $uri->withPath('foo/bar');
     $this->assertEquals('/foo/bar', $new->getPath());
 }