Skip to content

Commit

Permalink
test: #2 Add Uri parse only path case
Browse files Browse the repository at this point in the history
  • Loading branch information
t-terashima0815 committed Sep 5, 2023
1 parent 87de247 commit 86412b6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/units/Uri/UriTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 86412b6

Please sign in to comment.