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