Skip to content

Commit b34c8c6

Browse files
committed
Update uriparser + verify behavior
1 parent c22ffa1 commit b34c8c6

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

ext/uri/tests/026_userinfo.phpt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ var_dump($uri3->getUserInfo());
1616
var_dump($uri4->getUserInfo());
1717
var_dump($uri4->getRawUserInfo());
1818

19+
$uri1 = Uri\Rfc3986\Uri::parse("/foo");
20+
$uri2 = $uri1->withUserInfo(null);
21+
var_dump($uri2->getPort());
22+
1923
try {
2024
$uri4->withUserInfo("u:s/r");
2125
} catch (Uri\InvalidUriException $e) {
@@ -35,6 +39,7 @@ string(4) "user"
3539
NULL
3640
string(11) "us%2Fr:pass"
3741
string(13) "%75s%2Fr:pass"
42+
NULL
3843
The specified userinfo is malformed
3944
NULL
4045
string(9) "user:pass"

ext/uri/tests/027.phpt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,8 @@ var_dump($uri1->getPort());
2626
var_dump($uri2->getPort());
2727

2828
$uri1 = Uri\Rfc3986\Uri::parse("/foo");
29-
30-
try {
31-
$uri1->withPort(null); // TODO should not throw
32-
} catch (Uri\InvalidUriException $e) {
33-
echo $e->getMessage() . "\n";
34-
}
29+
$uri2 = $uri1->withPort(null);
30+
var_dump($uri2->getPort());
3531

3632
try {
3733
$uri1->withPort(1);
@@ -68,7 +64,7 @@ int(443)
6864
int(8080)
6965
NULL
7066
int(80)
71-
The specified port is malformed
67+
NULL
7268
The specified port is malformed
7369
int(8080)
7470
int(22)

0 commit comments

Comments
 (0)