Skip to content
This repository was archived by the owner on Sep 22, 2025. It is now read-only.

Commit 3ba186e

Browse files
committed
Normalize host to lowercase
1 parent e5c0a92 commit 3ba186e

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

tests/Rfc3986/UriTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use PHPUnit\Framework\TestCase;
2020
use ReflectionClass;
2121
use Uri\InvalidUriException;
22+
use const PHP_EOL;
2223

2324
#[CoversClass(Uri::class)]
2425
#[CoversClass(InvalidUriException::class)]
@@ -31,7 +32,7 @@ public function it_can_parse_an_uri(): void
3132

3233
self::assertInstanceOf(Uri::class, $uri);
3334
self::assertSame('http://example.com', $uri->toRawString());
34-
self::assertSame('http://example.com/', $uri->toString());
35+
self::assertSame('http://example.com', $uri->toString());
3536
}
3637

3738
#[Test]
@@ -287,6 +288,14 @@ public function it_can_update_the_user_info_component(): void
287288
self::assertTrue($uriStripped->withUserInfo(null)->equals($uriStripped));
288289
}
289290

291+
#[Test]
292+
public function it_can_noemalize_ip_v6_host(): void
293+
{
294+
$uri = new Uri("https://[2001:0db8:0001:0000:0000:0ab9:C0A8:0102]/?foo=bar%26baz%3Dqux");
295+
296+
self::assertSame("https://[2001:0db8:0001:0000:0000:0ab9:c0a8:0102]?foo=bar%26baz%3Dqux", $uri->toString());
297+
}
298+
290299
#[Test]
291300
public function it_can_not_update_invalid_path_according_to_rfc3986(): void
292301
{

0 commit comments

Comments
 (0)