ru_php/ext/uri/tests/040.phpt

56 lines
846 B
PHP

--TEST--
Test HTTP URL validation
--EXTENSIONS--
uri
--FILE--
<?php
$uri = Uri\Rfc3986\Uri::parse("https:example.com");
var_dump($uri);
var_dump($uri->toRawString());
$url = Uri\WhatWg\Url::parse("https:example.com");
var_dump($url);
var_dump($url->toAsciiString());
?>
--EXPECTF--
object(Uri\Rfc3986\Uri)#%d (%d) {
["scheme"]=>
string(5) "https"
["username"]=>
NULL
["password"]=>
NULL
["host"]=>
NULL
["port"]=>
NULL
["path"]=>
string(11) "example.com"
["query"]=>
NULL
["fragment"]=>
NULL
}
string(17) "https:example.com"
object(Uri\WhatWg\Url)#%d (%d) {
["scheme"]=>
string(5) "https"
["username"]=>
NULL
["password"]=>
NULL
["host"]=>
string(11) "example.com"
["port"]=>
NULL
["path"]=>
string(1) "/"
["query"]=>
NULL
["fragment"]=>
NULL
}
string(20) "https://example.com/"