diff --git a/tests/units/Uri/UriTest.php b/tests/units/Uri/UriTest.php index 4decad9..885db9f 100644 --- a/tests/units/Uri/UriTest.php +++ b/tests/units/Uri/UriTest.php @@ -79,6 +79,22 @@ public function testParseRootPath(): void $this->assertSame('https://example.co.jp/', $uri->__toString()); } + public function testParseOnlyPath(): void + { + $uri = Uri::parse('/foo/bar'); + + $this->assertInstanceOf(Uri::class, $uri); + $this->assertSame('', $uri->getScheme()); + $this->assertSame('', $uri->getUserInfo()); + $this->assertSame('', $uri->getHost()); + $this->assertSame(null, $uri->getPort()); + $this->assertSame('', $uri->getAuthority()); + $this->assertSame('/foo/bar', $uri->getPath()); + $this->assertSame('', $uri->getQuery()); + $this->assertSame('', $uri->getFragment()); + $this->assertSame(':///foo/bar', $uri->__toString()); + } + public function testGetAuthority(): void { $uri = new Uri(