diff --git a/ext/uri/tests/003.phpt b/ext/uri/tests/003.phpt deleted file mode 100644 index 38d62b0ec8e6..000000000000 --- a/ext/uri/tests/003.phpt +++ /dev/null @@ -1,89 +0,0 @@ ---TEST-- -Parse special URIs ---FILE-- - ---EXPECTF-- -NULL -object(Uri\WhatWg\Url)#%d (%d) { - ["scheme"]=> - string(4) "http" - ["username"]=> - string(8) "username" - ["password"]=> - string(8) "password" - ["host"]=> - string(18) "xn--hostname-b1aaa" - ["port"]=> - int(9090) - ["path"]=> - string(5) "/path" - ["query"]=> - string(14) "arg=va%C3%A9ue" - ["fragment"]=> - string(6) "anchor" -} -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - NULL - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - string(7) "host123" - ["port"]=> - NULL - ["path"]=> - string(1) "/" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - NULL - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - string(0) "" - ["port"]=> - NULL - ["path"]=> - string(5) "/foo/" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - NULL - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - NULL - ["port"]=> - NULL - ["path"]=> - string(7) "/page:1" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -NULL diff --git a/ext/uri/tests/004.phpt b/ext/uri/tests/004.phpt deleted file mode 100644 index c6ad96ce99a7..000000000000 --- a/ext/uri/tests/004.phpt +++ /dev/null @@ -1,83 +0,0 @@ ---TEST-- -Parse invalid URLs ---FILE-- -getMessage(), "\n"; -} - -var_dump(Uri\WhatWg\Url::parse("")); - -var_dump(Uri\Rfc3986\Uri::parse("192.168/contact.html")); -var_dump(Uri\WhatWg\Url::parse("192.168/contact.html", null)); - -var_dump(Uri\Rfc3986\Uri::parse("http://RuPaul's Drag Race All Stars 7 Winners Cast on This Season's")); -var_dump(Uri\WhatWg\Url::parse("http://RuPaul's Drag Race All Stars 7 Winners Cast on This Season's", null)); - -?> ---EXPECTF-- -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - NULL - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - NULL - ["port"]=> - NULL - ["path"]=> - string(0) "" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - NULL - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - NULL - ["port"]=> - NULL - ["path"]=> - string(0) "" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -Uri\WhatWg\InvalidUrlException: The specified URI is malformed (MissingSchemeNonRelativeUrl) -NULL -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - NULL - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - NULL - ["port"]=> - NULL - ["path"]=> - string(20) "192.168/contact.html" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -NULL -NULL -NULL diff --git a/ext/uri/tests/006.phpt b/ext/uri/tests/006.phpt deleted file mode 100644 index e7fa79a8b837..000000000000 --- a/ext/uri/tests/006.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -Test successful manual Uri child instance creation ---FILE-- - ---EXPECTF-- -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - string(5) "https" - ["username"]=> - string(8) "username" - ["password"]=> - string(8) "password" - ["host"]=> - string(11) "example.com" - ["port"]=> - int(8080) - ["path"]=> - string(5) "/path" - ["query"]=> - string(3) "q=r" - ["fragment"]=> - string(8) "fragment" -} -object(Uri\WhatWg\Url)#%d (%d) { - ["scheme"]=> - string(5) "https" - ["username"]=> - string(8) "username" - ["password"]=> - string(8) "password" - ["host"]=> - string(11) "example.com" - ["port"]=> - int(8080) - ["path"]=> - string(5) "/path" - ["query"]=> - string(3) "q=r" - ["fragment"]=> - string(8) "fragment" -} diff --git a/ext/uri/tests/007.phpt b/ext/uri/tests/007.phpt deleted file mode 100644 index 9d2f389e2513..000000000000 --- a/ext/uri/tests/007.phpt +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -Test URI creation errors ---FILE-- -getMessage(), "\n"; -} - -try { - new Uri\WhatWg\Url("https://example.com:8080@username:password/path?q=r#fragment"); -} catch (Throwable $e) { - echo $e::class, ': ', $e->getMessage(), "\n"; - var_dump($e->errors); -} - -$failures = []; -$url = new Uri\WhatWg\Url(" https://example.org ", null, $failures); -var_dump($url->toAsciiString()); -var_dump($failures); - -?> ---EXPECTF-- -Uri\InvalidUriException: The specified URI is malformed -Uri\WhatWg\InvalidUrlException: The specified URI is malformed (PortInvalid) -array(%d) { - [0]=> - object(Uri\WhatWg\UrlValidationError)#%d (%d) { - ["context"]=> - string(26) "password/path?q=r#fragment" - ["type"]=> - enum(Uri\WhatWg\UrlValidationErrorType::PortInvalid) - ["failure"]=> - bool(true) - } - [1]=> - object(Uri\WhatWg\UrlValidationError)#%d (%d) { - ["context"]=> - string(36) "@username:password/path?q=r#fragment" - ["type"]=> - enum(Uri\WhatWg\UrlValidationErrorType::InvalidCredentials) - ["failure"]=> - bool(false) - } -} -string(20) "https://example.org/" -array(2) { - [0]=> - object(Uri\WhatWg\UrlValidationError)#%d (%d) { - ["context"]=> - string(1) " " - ["type"]=> - enum(Uri\WhatWg\UrlValidationErrorType::InvalidUrlUnit) - ["failure"]=> - bool(false) - } - [1]=> - object(Uri\WhatWg\UrlValidationError)#%d (%d) { - ["context"]=> - string(21) " https://example.org " - ["type"]=> - enum(Uri\WhatWg\UrlValidationErrorType::InvalidUrlUnit) - ["failure"]=> - bool(false) - } -} diff --git a/ext/uri/tests/008.phpt b/ext/uri/tests/008.phpt deleted file mode 100644 index 0a02bae63163..000000000000 --- a/ext/uri/tests/008.phpt +++ /dev/null @@ -1,76 +0,0 @@ ---TEST-- -Test Uri getters ---FILE-- -getScheme()); - var_dump($uri->getRawScheme()); - var_dump($uri->getUsername()); - var_dump($uri->getRawUsername()); - var_dump($uri->getPassword()); - var_dump($uri->getRawPassword()); - var_dump($uri->getUserInfo()); - var_dump($uri->getRawUserInfo()); - var_dump($uri->getHost()); - var_dump($uri->getRawHost()); - var_dump($uri->getPort()); - var_dump($uri->getPath()); - var_dump($uri->getRawPath()); - var_dump($uri->getQuery()); - var_dump($uri->getRawQuery()); - var_dump($uri->getFragment()); - var_dump($uri->getRawFragment()); -} - -function callWhatWgGetters($url) -{ - var_dump($url->getScheme()); - var_dump($url->getUsername()); - var_dump($url->getPassword()); - var_dump($url->getAsciiHost()); - var_dump($url->getUnicodeHost()); - var_dump($url->getPort()); - var_dump($url->getPath()); - var_dump($url->getQuery()); - var_dump($url->getFragment()); -} - -$uri = Uri\Rfc3986\Uri::parse("https://username:password@www.example.com:8080/pathname1/pathname2/pathname3?query=true#hash-exists"); -callRfc3986Getters($uri); - -echo "\n"; - -$url = Uri\WhatWg\Url::parse("https://username:password@www.example.com:8080/pathname1/pathname2/pathname3?query=true#hash-exists"); -callWhatWgGetters($url); - -?> ---EXPECT-- -string(5) "https" -string(5) "https" -string(8) "username" -string(8) "username" -string(8) "password" -string(8) "password" -string(17) "username:password" -string(17) "username:password" -string(15) "www.example.com" -string(15) "www.example.com" -int(8080) -string(30) "/pathname1/pathname2/pathname3" -string(30) "/pathname1/pathname2/pathname3" -string(10) "query=true" -string(10) "query=true" -string(11) "hash-exists" -string(11) "hash-exists" - -string(5) "https" -string(8) "username" -string(8) "password" -string(15) "www.example.com" -string(15) "www.example.com" -int(8080) -string(30) "/pathname1/pathname2/pathname3" -string(10) "query=true" -string(11) "hash-exists" diff --git a/ext/uri/tests/009.phpt b/ext/uri/tests/009.phpt deleted file mode 100644 index 9c896d0153b2..000000000000 --- a/ext/uri/tests/009.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test parsing with IANA schemes ---FILE-- - ---EXPECTF-- -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - string(16) "chrome-extension" - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - string(11) "example.com" - ["port"]=> - NULL - ["path"]=> - string(0) "" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -object(Uri\WhatWg\Url)#%d (%d) { - ["scheme"]=> - string(16) "chrome-extension" - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - string(11) "example.com" - ["port"]=> - NULL - ["path"]=> - string(0) "" - ["query"]=> - NULL - ["fragment"]=> - NULL -} diff --git a/ext/uri/tests/010.phpt b/ext/uri/tests/010.phpt deleted file mode 100644 index ff5a37000775..000000000000 --- a/ext/uri/tests/010.phpt +++ /dev/null @@ -1,84 +0,0 @@ ---TEST-- -Test parsing URIs when a base URI is present ---FILE-- - ---EXPECTF-- -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - string(4) "http" - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - string(11) "example.com" - ["port"]=> - NULL - ["path"]=> - string(14) "/path/to/file2" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - string(5) "https" - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - string(8) "test.com" - ["port"]=> - NULL - ["path"]=> - string(14) "/path/to/file2" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -object(Uri\WhatWg\Url)#%d (%d) { - ["scheme"]=> - string(4) "http" - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - string(11) "example.com" - ["port"]=> - NULL - ["path"]=> - string(14) "/path/to/file1" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -object(Uri\WhatWg\Url)#%d (%d) { - ["scheme"]=> - string(5) "https" - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - string(8) "test.com" - ["port"]=> - NULL - ["path"]=> - string(14) "/path/to/file1" - ["query"]=> - NULL - ["fragment"]=> - NULL -} diff --git a/ext/uri/tests/011.phpt b/ext/uri/tests/011.phpt deleted file mode 100644 index 0e8fd8ec8f48..000000000000 --- a/ext/uri/tests/011.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Test encoding and normalization ---FILE-- -toRawString()); -var_dump(Uri\Rfc3986\Uri::parse("https://www.example.com/dir1/../dir2")->toRawString()); -var_dump(Uri\Rfc3986\Uri::parse("https://你好你好")); -var_dump(Uri\Rfc3986\Uri::parse("https://0Xc0.0250.01")); -var_dump(Uri\Rfc3986\Uri::parse("HttPs://0300.0250.0000.0001/path?query=foo%20bar")->toRawString()); - -var_dump(Uri\WhatWg\Url::parse("http://////www.EXAMPLE.com:80")->toAsciiString()); -var_dump(Uri\WhatWg\Url::parse("https://www.example.com:443/dir1/../dir2")->toAsciiString()); -var_dump(Uri\WhatWg\Url::parse("https://你好你好")->toAsciiString()); -var_dump(Uri\WhatWg\Url::parse("https://你好你好")->toUnicodeString()); -var_dump(Uri\WhatWg\Url::parse("https://0Xc0.0250.01")->toAsciiString()); -var_dump(Uri\WhatWg\Url::parse("HttPs://0300.0250.0000.0001/path?query=foo%20bar")->toAsciiString()); - -?> ---EXPECT-- -string(29) "http://////www.EXAMPLE.com:80" -string(36) "https://www.example.com/dir1/../dir2" -NULL -NULL -string(48) "HttPs://0300.0250.0000.0001/path?query=foo%20bar" -string(23) "http://www.example.com/" -string(28) "https://www.example.com/dir2" -string(23) "https://xn--6qqa088eba/" -string(21) "https://你好你好/" -string(20) "https://192.168.0.1/" -string(40) "https://192.168.0.1/path?query=foo%20bar" diff --git a/ext/uri/tests/012.phpt b/ext/uri/tests/012.phpt deleted file mode 100644 index e033223a6426..000000000000 --- a/ext/uri/tests/012.phpt +++ /dev/null @@ -1,85 +0,0 @@ ---TEST-- -Test parsing of various schemes ---FILE-- - ---EXPECTF-- -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - string(6) "mailto" - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - NULL - ["port"]=> - NULL - ["path"]=> - string(15) "Joe@Example.COM" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -object(Uri\WhatWg\Url)#%d (%d) { - ["scheme"]=> - string(6) "mailto" - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - NULL - ["port"]=> - NULL - ["path"]=> - string(15) "Joe@Example.COM" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -object(Uri\Rfc3986\Uri)#%d (%d) { - ["scheme"]=> - string(4) "file" - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - string(0) "" - ["port"]=> - NULL - ["path"]=> - string(30) "/E:/Documents%20and%20Settings" - ["query"]=> - NULL - ["fragment"]=> - NULL -} -object(Uri\WhatWg\Url)#%d (%d) { - ["scheme"]=> - string(4) "file" - ["username"]=> - NULL - ["password"]=> - NULL - ["host"]=> - string(0) "" - ["port"]=> - NULL - ["path"]=> - string(30) "/E:/Documents%20and%20Settings" - ["query"]=> - NULL - ["fragment"]=> - NULL -} diff --git a/ext/uri/tests/013.phpt b/ext/uri/tests/013.phpt deleted file mode 100644 index 865843ec27e8..000000000000 --- a/ext/uri/tests/013.phpt +++ /dev/null @@ -1,129 +0,0 @@ ---TEST-- -Test parsing of query strings ---FILE-- - + @")); - -var_dump(Uri\WhatWg\Url::parse("http://example.com?foobar=%27%3Cscript%3E+%2B+%40")); -var_dump(Uri\WhatWg\Url::parse("http://example.com?foobar='