This repository was archived by the owner on Sep 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919use PHPUnit \Framework \TestCase ;
2020use ReflectionClass ;
2121use 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 {
You can’t perform that action at this time.
0 commit comments