UriTest
extends Test
in package
Class UriTest
Table of Contents
Properties
Methods
- testAddNonce() : void
- testBase() : void
- testBasename() : void
- testBuildUrl() : void
- testConvertUrl() : void
- testCurrentPage() : void
- testCustomBase() : void
- testEnvironment() : void
- testExtension() : void
- testFragment() : void
- testHost() : void
- testIp() : void
- testIsExternal() : void
- testParam() : void
- testParams() : void
- testPassword() : void
- testPath() : void
- testPaths() : void
- testPort() : void
- testQuery() : void
- testReferrer() : void
- testRootUrl() : void
- testRoute() : void
- testScheme() : void
- testToString() : void
- testUrl() : void
- testUser() : void
- testValidatingHostname() : void
- _after() : void
- _before() : void
- runTestSet() : void
Properties
$config
protected
Config
$config
$grav
protected
Grav
$grav
$tests
protected
mixed
$tests
= [
'/path' => ['scheme' => '', 'user' => \null, 'password' => \null, 'host' => \null, 'port' => \null, 'path' => '/path', 'query' => '', 'fragment' => \null, 'route' => '/path', 'paths' => ['path'], 'params' => \null, 'url' => '/path', 'environment' => 'unknown', 'basename' => 'path', 'base' => '', 'currentPage' => 1, 'rootUrl' => '', 'extension' => \null, 'addNonce' => '/path/nonce:{{nonce}}'],
'//localhost/' => ['scheme' => '//', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => \null, 'path' => '/', 'query' => '', 'fragment' => \null, 'route' => '/', 'paths' => [], 'params' => \null, 'url' => '/', 'environment' => 'localhost', 'basename' => '', 'base' => '//localhost', 'currentPage' => 1, 'rootUrl' => '//localhost', 'extension' => \null, 'addNonce' => '//localhost/nonce:{{nonce}}'],
'http://localhost/' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 80, 'path' => '/', 'query' => '', 'fragment' => \null, 'route' => '/', 'paths' => [], 'params' => \null, 'url' => '/', 'environment' => 'localhost', 'basename' => '', 'base' => 'http://localhost', 'currentPage' => 1, 'rootUrl' => 'http://localhost', 'extension' => \null, 'addNonce' => 'http://localhost/nonce:{{nonce}}'],
'http://127.0.0.1/' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => '127.0.0.1', 'port' => 80, 'path' => '/', 'query' => '', 'fragment' => \null, 'route' => '/', 'paths' => [], 'params' => \null, 'url' => '/', 'environment' => 'localhost', 'basename' => '', 'base' => 'http://127.0.0.1', 'currentPage' => 1, 'rootUrl' => 'http://127.0.0.1', 'extension' => \null, 'addNonce' => 'http://127.0.0.1/nonce:{{nonce}}'],
'https://localhost/' => ['scheme' => 'https://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 443, 'path' => '/', 'query' => '', 'fragment' => \null, 'route' => '/', 'paths' => [], 'params' => \null, 'url' => '/', 'environment' => 'localhost', 'basename' => '', 'base' => 'https://localhost', 'currentPage' => 1, 'rootUrl' => 'https://localhost', 'extension' => \null, 'addNonce' => 'https://localhost/nonce:{{nonce}}'],
'http://localhost:8080/grav/it/ueper' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 8080, 'path' => '/grav/it/ueper', 'query' => '', 'fragment' => \null, 'route' => '/grav/it/ueper', 'paths' => ['grav', 'it', 'ueper'], 'params' => \null, 'url' => '/grav/it/ueper', 'environment' => 'localhost', 'basename' => 'ueper', 'base' => 'http://localhost:8080', 'currentPage' => 1, 'rootUrl' => 'http://localhost:8080', 'extension' => \null, 'addNonce' => 'http://localhost:8080/grav/it/ueper/nonce:{{nonce}}'],
'http://localhost:8080/grav/it/ueper:xxx' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 8080, 'path' => '/grav/it', 'query' => '', 'fragment' => \null, 'route' => '/grav/it', 'paths' => ['grav', 'it'], 'params' => '/ueper:xxx', 'url' => '/grav/it', 'environment' => 'localhost', 'basename' => 'it', 'base' => 'http://localhost:8080', 'currentPage' => 1, 'rootUrl' => 'http://localhost:8080', 'extension' => \null, 'addNonce' => 'http://localhost:8080/grav/it/ueper:xxx/nonce:{{nonce}}'],
'http://localhost:8080/grav/it/ueper:xxx/page:/test:yyy' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 8080, 'path' => '/grav/it', 'query' => '', 'fragment' => \null, 'route' => '/grav/it', 'paths' => ['grav', 'it'], 'params' => '/ueper:xxx/page:/test:yyy', 'url' => '/grav/it', 'environment' => 'localhost', 'basename' => 'it', 'base' => 'http://localhost:8080', 'currentPage' => 1, 'rootUrl' => 'http://localhost:8080', 'extension' => \null, 'addNonce' => 'http://localhost:8080/grav/it/ueper:xxx/page:/test:yyy/nonce:{{nonce}}'],
'http://localhost:8080/grav/it/ueper?test=x' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 8080, 'path' => '/grav/it/ueper', 'query' => 'test=x', 'fragment' => \null, 'route' => '/grav/it/ueper', 'paths' => ['grav', 'it', 'ueper'], 'params' => \null, 'url' => '/grav/it/ueper', 'environment' => 'localhost', 'basename' => 'ueper', 'base' => 'http://localhost:8080', 'currentPage' => 1, 'rootUrl' => 'http://localhost:8080', 'extension' => \null, 'addNonce' => 'http://localhost:8080/grav/it/ueper/nonce:{{nonce}}?test=x'],
'http://localhost:80/grav/it/ueper?test=x' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 80, 'path' => '/grav/it/ueper', 'query' => 'test=x', 'fragment' => \null, 'route' => '/grav/it/ueper', 'paths' => ['grav', 'it', 'ueper'], 'params' => \null, 'url' => '/grav/it/ueper', 'environment' => 'localhost', 'basename' => 'ueper', 'base' => 'http://localhost:80', 'currentPage' => 1, 'rootUrl' => 'http://localhost:80', 'extension' => \null, 'addNonce' => 'http://localhost:80/grav/it/ueper/nonce:{{nonce}}?test=x'],
'http://localhost/grav/it/ueper?test=x' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 80, 'path' => '/grav/it/ueper', 'query' => 'test=x', 'fragment' => \null, 'route' => '/grav/it/ueper', 'paths' => ['grav', 'it', 'ueper'], 'params' => \null, 'url' => '/grav/it/ueper', 'environment' => 'localhost', 'basename' => 'ueper', 'base' => 'http://localhost', 'currentPage' => 1, 'rootUrl' => 'http://localhost', 'extension' => \null, 'addNonce' => 'http://localhost/grav/it/ueper/nonce:{{nonce}}?test=x'],
'http://grav/grav/it/ueper' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'grav', 'port' => 80, 'path' => '/grav/it/ueper', 'query' => '', 'fragment' => \null, 'route' => '/grav/it/ueper', 'paths' => ['grav', 'it', 'ueper'], 'params' => \null, 'url' => '/grav/it/ueper', 'environment' => 'grav', 'basename' => 'ueper', 'base' => 'http://grav', 'currentPage' => 1, 'rootUrl' => 'http://grav', 'extension' => \null, 'addNonce' => 'http://grav/grav/it/ueper/nonce:{{nonce}}'],
'https://username:password@api.getgrav.com:4040/v1/post/128/page:x/?all=1' => [
'scheme' => 'https://',
'user' => 'username',
'password' => 'password',
'host' => 'api.getgrav.com',
'port' => 4040,
'path' => '/v1/post/128/',
// FIXME <-
'query' => 'all=1',
'fragment' => \null,
'route' => '/v1/post/128',
'paths' => ['v1', 'post', '128'],
'params' => '/page:x',
'url' => '/v1/post/128',
'environment' => 'api.getgrav.com',
'basename' => '128',
'base' => 'https://api.getgrav.com:4040',
'currentPage' => 1,
'rootUrl' => 'https://api.getgrav.com:4040',
'extension' => \null,
'addNonce' => 'https://username:password@api.getgrav.com:4040/v1/post/128/page:x/nonce:{{nonce}}?all=1',
'toOriginalString' => 'https://username:password@api.getgrav.com:4040/v1/post/128/page:x?all=1',
],
'https://google.com:443/' => ['scheme' => 'https://', 'user' => \null, 'password' => \null, 'host' => 'google.com', 'port' => 443, 'path' => '/', 'query' => '', 'fragment' => \null, 'route' => '/', 'paths' => [], 'params' => \null, 'url' => '/', 'environment' => 'google.com', 'basename' => '', 'base' => 'https://google.com:443', 'currentPage' => 1, 'rootUrl' => 'https://google.com:443', 'extension' => \null, 'addNonce' => 'https://google.com:443/nonce:{{nonce}}'],
// Path tests.
'http://localhost:8080/a/b/c/d' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 8080, 'path' => '/a/b/c/d', 'query' => '', 'fragment' => \null, 'route' => '/a/b/c/d', 'paths' => ['a', 'b', 'c', 'd'], 'params' => \null, 'url' => '/a/b/c/d', 'environment' => 'localhost', 'basename' => 'd', 'base' => 'http://localhost:8080', 'currentPage' => 1, 'rootUrl' => 'http://localhost:8080', 'extension' => \null, 'addNonce' => 'http://localhost:8080/a/b/c/d/nonce:{{nonce}}'],
'http://localhost:8080/a/b/c/d/e/f/a/b/c/d/e/f/a/b/c/d/e/f' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 8080, 'path' => '/a/b/c/d/e/f/a/b/c/d/e/f/a/b/c/d/e/f', 'query' => '', 'fragment' => \null, 'route' => '/a/b/c/d/e/f/a/b/c/d/e/f/a/b/c/d/e/f', 'paths' => ['a', 'b', 'c', 'd', 'e', 'f', 'a', 'b', 'c', 'd', 'e', 'f', 'a', 'b', 'c', 'd', 'e', 'f'], 'params' => \null, 'url' => '/a/b/c/d/e/f/a/b/c/d/e/f/a/b/c/d/e/f', 'environment' => 'localhost', 'basename' => 'f', 'base' => 'http://localhost:8080', 'currentPage' => 1, 'rootUrl' => 'http://localhost:8080', 'extension' => \null, 'addNonce' => 'http://localhost:8080/a/b/c/d/e/f/a/b/c/d/e/f/a/b/c/d/e/f/nonce:{{nonce}}'],
'http://localhost/this is the path/my page' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 80, 'path' => '/this%20is%20the%20path/my%20page', 'query' => '', 'fragment' => \null, 'route' => '/this%20is%20the%20path/my%20page', 'paths' => ['this%20is%20the%20path', 'my%20page'], 'params' => \null, 'url' => '/this%20is%20the%20path/my%20page', 'environment' => 'localhost', 'basename' => 'my%20page', 'base' => 'http://localhost', 'currentPage' => 1, 'rootUrl' => 'http://localhost', 'extension' => \null, 'addNonce' => 'http://localhost/this%20is%20the%20path/my%20page/nonce:{{nonce}}', 'toOriginalString' => 'http://localhost/this%20is%20the%20path/my%20page'],
'http://localhost/pölöpölö/päläpälä' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 80, 'path' => '/p%C3%B6l%C3%B6p%C3%B6l%C3%B6/p%C3%A4l%C3%A4p%C3%A4l%C3%A4', 'query' => '', 'fragment' => \null, 'route' => '/p%C3%B6l%C3%B6p%C3%B6l%C3%B6/p%C3%A4l%C3%A4p%C3%A4l%C3%A4', 'paths' => ['p%C3%B6l%C3%B6p%C3%B6l%C3%B6', 'p%C3%A4l%C3%A4p%C3%A4l%C3%A4'], 'params' => \null, 'url' => '/p%C3%B6l%C3%B6p%C3%B6l%C3%B6/p%C3%A4l%C3%A4p%C3%A4l%C3%A4', 'environment' => 'localhost', 'basename' => 'p%C3%A4l%C3%A4p%C3%A4l%C3%A4', 'base' => 'http://localhost', 'currentPage' => 1, 'rootUrl' => 'http://localhost', 'extension' => \null, 'addNonce' => 'http://localhost/p%C3%B6l%C3%B6p%C3%B6l%C3%B6/p%C3%A4l%C3%A4p%C3%A4l%C3%A4/nonce:{{nonce}}', 'toOriginalString' => 'http://localhost/p%C3%B6l%C3%B6p%C3%B6l%C3%B6/p%C3%A4l%C3%A4p%C3%A4l%C3%A4'],
// Query params tests.
'http://localhost:8080/grav/it/ueper?test=x&test2=y' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 8080, 'path' => '/grav/it/ueper', 'query' => 'test=x&test2=y', 'fragment' => \null, 'route' => '/grav/it/ueper', 'paths' => ['grav', 'it', 'ueper'], 'params' => \null, 'url' => '/grav/it/ueper', 'environment' => 'localhost', 'basename' => 'ueper', 'base' => 'http://localhost:8080', 'currentPage' => 1, 'rootUrl' => 'http://localhost:8080', 'extension' => \null, 'addNonce' => 'http://localhost:8080/grav/it/ueper/nonce:{{nonce}}?test=x&test2=y'],
'http://localhost:8080/grav/it/ueper?test=x&test2=y&test3=x&test4=y' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 8080, 'path' => '/grav/it/ueper', 'query' => 'test=x&test2=y&test3=x&test4=y', 'fragment' => \null, 'route' => '/grav/it/ueper', 'paths' => ['grav', 'it', 'ueper'], 'params' => \null, 'url' => '/grav/it/ueper', 'environment' => 'localhost', 'basename' => 'ueper', 'base' => 'http://localhost:8080', 'currentPage' => 1, 'rootUrl' => 'http://localhost:8080', 'extension' => \null, 'addNonce' => 'http://localhost:8080/grav/it/ueper/nonce:{{nonce}}?test=x&test2=y&test3=x&test4=y'],
'http://localhost:8080/grav/it/ueper?test=x&test2=y&test3=x&test4=y/test' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 8080, 'path' => '/grav/it/ueper', 'query' => 'test=x&test2=y&test3=x&test4=y%2Ftest', 'fragment' => \null, 'route' => '/grav/it/ueper', 'paths' => ['grav', 'it', 'ueper'], 'params' => \null, 'url' => '/grav/it/ueper', 'environment' => 'localhost', 'basename' => 'ueper', 'base' => 'http://localhost:8080', 'currentPage' => 1, 'rootUrl' => 'http://localhost:8080', 'extension' => \null, 'addNonce' => 'http://localhost:8080/grav/it/ueper/nonce:{{nonce}}?test=x&test2=y&test3=x&test4=y/test'],
// Port tests.
'http://localhost/a-page' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 80, 'path' => '/a-page', 'query' => '', 'fragment' => \null, 'route' => '/a-page', 'paths' => ['a-page'], 'params' => \null, 'url' => '/a-page', 'environment' => 'localhost', 'basename' => 'a-page', 'base' => 'http://localhost', 'currentPage' => 1, 'rootUrl' => 'http://localhost', 'extension' => \null, 'addNonce' => 'http://localhost/a-page/nonce:{{nonce}}'],
'http://localhost:8080/a-page' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 8080, 'path' => '/a-page', 'query' => '', 'fragment' => \null, 'route' => '/a-page', 'paths' => ['a-page'], 'params' => \null, 'url' => '/a-page', 'environment' => 'localhost', 'basename' => 'a-page', 'base' => 'http://localhost:8080', 'currentPage' => 1, 'rootUrl' => 'http://localhost:8080', 'extension' => \null, 'addNonce' => 'http://localhost:8080/a-page/nonce:{{nonce}}'],
'http://localhost:443/a-page' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 443, 'path' => '/a-page', 'query' => '', 'fragment' => \null, 'route' => '/a-page', 'paths' => ['a-page'], 'params' => \null, 'url' => '/a-page', 'environment' => 'localhost', 'basename' => 'a-page', 'base' => 'http://localhost:443', 'currentPage' => 1, 'rootUrl' => 'http://localhost:443', 'extension' => \null, 'addNonce' => 'http://localhost:443/a-page/nonce:{{nonce}}'],
// Extension tests.
'http://localhost/a-page.html' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 80, 'path' => '/a-page', 'query' => '', 'fragment' => \null, 'route' => '/a-page', 'paths' => ['a-page'], 'params' => \null, 'url' => '/a-page', 'environment' => 'localhost', 'basename' => 'a-page.html', 'base' => 'http://localhost', 'currentPage' => 1, 'rootUrl' => 'http://localhost', 'extension' => 'html', 'addNonce' => 'http://localhost/a-page.html/nonce:{{nonce}}', 'toOriginalString' => 'http://localhost/a-page.html'],
'http://localhost/a-page.json' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 80, 'path' => '/a-page', 'query' => '', 'fragment' => \null, 'route' => '/a-page', 'paths' => ['a-page'], 'params' => \null, 'url' => '/a-page', 'environment' => 'localhost', 'basename' => 'a-page.json', 'base' => 'http://localhost', 'currentPage' => 1, 'rootUrl' => 'http://localhost', 'extension' => 'json', 'addNonce' => 'http://localhost/a-page.json/nonce:{{nonce}}', 'toOriginalString' => 'http://localhost/a-page.json'],
'http://localhost/admin/ajax.json/task:getnewsfeed' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 80, 'path' => '/admin/ajax', 'query' => '', 'fragment' => \null, 'route' => '/admin/ajax', 'paths' => ['admin', 'ajax'], 'params' => '/task:getnewsfeed', 'url' => '/admin/ajax', 'environment' => 'localhost', 'basename' => 'ajax.json', 'base' => 'http://localhost', 'currentPage' => 1, 'rootUrl' => 'http://localhost', 'extension' => 'json', 'addNonce' => 'http://localhost/admin/ajax.json/task:getnewsfeed/nonce:{{nonce}}', 'toOriginalString' => 'http://localhost/admin/ajax.json/task:getnewsfeed'],
'http://localhost/grav/admin/media.json/route:L1VzZXJzL3JodWsvd29ya3NwYWNlL2dyYXYtZGVtby1zYW1wbGVyL3VzZXIvYXNzZXRzL3FRMXB4Vk1ERTNJZzh5Ni5qcGc=/task:removeFileFromBlueprint/proute:/blueprint:Y29uZmlnL2RldGFpbHM=/type:config/field:deep.nested.custom_file/path:dXNlci9hc3NldHMvcVExcHhWTURFM0lnOHk2LmpwZw==' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 80, 'path' => '/grav/admin/media', 'query' => '', 'fragment' => \null, 'route' => '/grav/admin/media', 'paths' => ['grav', 'admin', 'media'], 'params' => '/route:L1VzZXJzL3JodWsvd29ya3NwYWNlL2dyYXYtZGVtby1zYW1wbGVyL3VzZXIvYXNzZXRzL3FRMXB4Vk1ERTNJZzh5Ni5qcGc=/task:removeFileFromBlueprint/proute:/blueprint:Y29uZmlnL2RldGFpbHM=/type:config/field:deep.nested.custom_file/path:dXNlci9hc3NldHMvcVExcHhWTURFM0lnOHk2LmpwZw==', 'url' => '/grav/admin/media', 'environment' => 'localhost', 'basename' => 'media.json', 'base' => 'http://localhost', 'currentPage' => 1, 'rootUrl' => 'http://localhost', 'extension' => 'json', 'addNonce' => 'http://localhost/grav/admin/media.json/route:L1VzZXJzL3JodWsvd29ya3NwYWNlL2dyYXYtZGVtby1zYW1wbGVyL3VzZXIvYXNzZXRzL3FRMXB4Vk1ERTNJZzh5Ni5qcGc=/task:removeFileFromBlueprint/proute:/blueprint:Y29uZmlnL2RldGFpbHM=/type:config/field:deep.nested.custom_file/path:dXNlci9hc3NldHMvcVExcHhWTURFM0lnOHk2LmpwZw==/nonce:{{nonce}}', 'toOriginalString' => 'http://localhost/grav/admin/media.json/route:L1VzZXJzL3JodWsvd29ya3NwYWNlL2dyYXYtZGVtby1zYW1wbGVyL3VzZXIvYXNzZXRzL3FRMXB4Vk1ERTNJZzh5Ni5qcGc=/task:removeFileFromBlueprint/proute:/blueprint:Y29uZmlnL2RldGFpbHM=/type:config/field:deep.nested.custom_file/path:dXNlci9hc3NldHMvcVExcHhWTURFM0lnOHk2LmpwZw=='],
'http://localhost/a-page.foo' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 80, 'path' => '/a-page.foo', 'query' => '', 'fragment' => \null, 'route' => '/a-page.foo', 'paths' => ['a-page.foo'], 'params' => \null, 'url' => '/a-page.foo', 'environment' => 'localhost', 'basename' => 'a-page.foo', 'base' => 'http://localhost', 'currentPage' => 1, 'rootUrl' => 'http://localhost', 'extension' => 'foo', 'addNonce' => 'http://localhost/a-page.foo/nonce:{{nonce}}', 'toOriginalString' => 'http://localhost/a-page.foo'],
// Fragment tests.
'http://localhost:8080/a/b/c#my-fragment' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 8080, 'path' => '/a/b/c', 'query' => '', 'fragment' => 'my-fragment', 'route' => '/a/b/c', 'paths' => ['a', 'b', 'c'], 'params' => \null, 'url' => '/a/b/c', 'environment' => 'localhost', 'basename' => 'c', 'base' => 'http://localhost:8080', 'currentPage' => 1, 'rootUrl' => 'http://localhost:8080', 'extension' => \null, 'addNonce' => 'http://localhost:8080/a/b/c/nonce:{{nonce}}#my-fragment'],
// Attacks.
'"><script>alert</script>://localhost' => [
'scheme' => '',
'user' => \null,
'password' => \null,
'host' => \null,
'port' => \null,
'path' => '/localhost',
'query' => '',
'fragment' => \null,
'route' => '/localhost',
'paths' => ['localhost'],
'params' => '/script%3E:',
'url' => '/localhost',
'environment' => 'unknown',
'basename' => 'localhost',
'base' => '',
'currentPage' => 1,
'rootUrl' => '',
'extension' => \null,
//'addNonce' => '%22%3E%3Cscript%3Ealert%3C/localhost/script%3E:/nonce:{{nonce}}', // FIXME <-
'toOriginalString' => '/localhost/script%3E:',
],
'http://"><script>alert</script>' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'unknown', 'port' => 80, 'path' => '/script%3E', 'query' => '', 'fragment' => \null, 'route' => '/script%3E', 'paths' => ['script%3E'], 'params' => \null, 'url' => '/script%3E', 'environment' => 'unknown', 'basename' => 'script%3E', 'base' => 'http://unknown', 'currentPage' => 1, 'rootUrl' => 'http://unknown', 'extension' => \null, 'addNonce' => 'http://unknown/script%3E/nonce:{{nonce}}', 'toOriginalString' => 'http://unknown/script%3E'],
'http://localhost/"><script>alert</script>' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 80, 'path' => '/%22%3E%3Cscript%3Ealert%3C/script%3E', 'query' => '', 'fragment' => \null, 'route' => '/%22%3E%3Cscript%3Ealert%3C/script%3E', 'paths' => ['%22%3E%3Cscript%3Ealert%3C', 'script%3E'], 'params' => \null, 'url' => '/%22%3E%3Cscript%3Ealert%3C/script%3E', 'environment' => 'localhost', 'basename' => 'script%3E', 'base' => 'http://localhost', 'currentPage' => 1, 'rootUrl' => 'http://localhost', 'extension' => \null, 'addNonce' => 'http://localhost/%22%3E%3Cscript%3Ealert%3C/script%3E/nonce:{{nonce}}', 'toOriginalString' => 'http://localhost/%22%3E%3Cscript%3Ealert%3C/script%3E'],
'http://localhost/something/p1:foo/p2:"><script>alert</script>' => [
'scheme' => 'http://',
'user' => \null,
'password' => \null,
'host' => 'localhost',
'port' => 80,
'path' => '/something/script%3E',
'query' => '',
'fragment' => \null,
'route' => '/something/script%3E',
'paths' => ['something', 'script%3E'],
'params' => '/p1:foo/p2:%22%3E%3Cscript%3Ealert%3C',
'url' => '/something/script%3E',
'environment' => 'localhost',
'basename' => 'script%3E',
'base' => 'http://localhost',
'currentPage' => 1,
'rootUrl' => 'http://localhost',
'extension' => \null,
//'addNonce' => 'http://localhost/something/script%3E/p1:foo/p2:%22%3E%3Cscript%3Ealert%3C/nonce:{{nonce}}', // FIXME <-
'toOriginalString' => 'http://localhost/something/script%3E/p1:foo/p2:%22%3E%3Cscript%3Ealert%3C',
],
'http://localhost/something?p="><script>alert</script>' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 80, 'path' => '/something', 'query' => 'p=%22%3E%3Cscript%3Ealert%3C%2Fscript%3E', 'fragment' => \null, 'route' => '/something', 'paths' => ['something'], 'params' => \null, 'url' => '/something', 'environment' => 'localhost', 'basename' => 'something', 'base' => 'http://localhost', 'currentPage' => 1, 'rootUrl' => 'http://localhost', 'extension' => \null, 'addNonce' => 'http://localhost/something/nonce:{{nonce}}?p=%22%3E%3Cscript%3Ealert%3C/script%3E', 'toOriginalString' => 'http://localhost/something?p=%22%3E%3Cscript%3Ealert%3C/script%3E'],
'http://localhost/something#"><script>alert</script>' => ['scheme' => 'http://', 'user' => \null, 'password' => \null, 'host' => 'localhost', 'port' => 80, 'path' => '/something', 'query' => '', 'fragment' => '%22%3E%3Cscript%3Ealert%3C/script%3E', 'route' => '/something', 'paths' => ['something'], 'params' => \null, 'url' => '/something', 'environment' => 'localhost', 'basename' => 'something', 'base' => 'http://localhost', 'currentPage' => 1, 'rootUrl' => 'http://localhost', 'extension' => \null, 'addNonce' => 'http://localhost/something/nonce:{{nonce}}#%22%3E%3Cscript%3Ealert%3C/script%3E', 'toOriginalString' => 'http://localhost/something#%22%3E%3Cscript%3Ealert%3C/script%3E'],
'https://www.getgrav.org/something/"><script>eval(atob("aGlzdG9yeS5wdXNoU3RhdGUoJycsJycsJy8nKTskKCdoZWFkLGJvZHknKS5odG1sKCcnKS5sb2FkKCcvJyk7JC5wb3N0KCcvYWRtaW4nLGZ1bmN0aW9uKGRhdGEpeyQucG9zdCgkKGRhdGEpLmZpbmQoJ1tpZD1hZG1pbi11c2VyLWRldGFpbHNdIGEnKS5hdHRyKCdocmVmJykseydhZG1pbi1ub25jZSc6JChkYXRhKS5maW5kKCdbZGF0YS1jbGVhci1jYWNoZV0nKS5hdHRyKCdkYXRhLWNsZWFyLWNhY2hlJykuc3BsaXQoJzonKS5wb3AoKS50cmltKCksJ2RhdGFbcGFzc3dvcmRdJzonSW0zdjFsaDR4eDByJywndGFzayc6J3NhdmUnfSl9KQ=="))</script><' => ['scheme' => 'https://', 'user' => \null, 'password' => \null, 'host' => 'www.getgrav.org', 'port' => 443, 'path' => '/something/%22%3E%3Cscript%3Eeval%28atob%28%22aGlzdG9yeS5wdXNoU3RhdGUoJycsJycsJy8nKTskKCdoZWFkLGJvZHknKS5odG1sKCcnKS5sb2FkKCcvJyk7JC5wb3N0KCcvYWRtaW4nLGZ1bmN0aW9uKGRhdGEpeyQucG9zdCgkKGRhdGEpLmZpbmQoJ1tpZD1hZG1pbi11c2VyLWRldGFpbHNdIGEnKS5hdHRyKCdocmVmJykseydhZG1pbi1ub25jZSc6JChkYXRhKS5maW5kKCdbZGF0YS1jbGVhci1jYWNoZV0nKS5hdHRyKCdkYXRhLWNsZWFyLWNhY2hlJykuc3BsaXQoJzonKS5wb3AoKS50cmltKCksJ2RhdGFbcGFzc3dvcmRdJzonSW0zdjFsaDR4eDByJywndGFzayc6J3NhdmUnfSl9KQ==%22%29%29%3C/script%3E%3C', 'query' => '', 'fragment' => \null, 'route' => '/something/%22%3E%3Cscript%3Eeval%28atob%28%22aGlzdG9yeS5wdXNoU3RhdGUoJycsJycsJy8nKTskKCdoZWFkLGJvZHknKS5odG1sKCcnKS5sb2FkKCcvJyk7JC5wb3N0KCcvYWRtaW4nLGZ1bmN0aW9uKGRhdGEpeyQucG9zdCgkKGRhdGEpLmZpbmQoJ1tpZD1hZG1pbi11c2VyLWRldGFpbHNdIGEnKS5hdHRyKCdocmVmJykseydhZG1pbi1ub25jZSc6JChkYXRhKS5maW5kKCdbZGF0YS1jbGVhci1jYWNoZV0nKS5hdHRyKCdkYXRhLWNsZWFyLWNhY2hlJykuc3BsaXQoJzonKS5wb3AoKS50cmltKCksJ2RhdGFbcGFzc3dvcmRdJzonSW0zdjFsaDR4eDByJywndGFzayc6J3NhdmUnfSl9KQ==%22%29%29%3C/script%3E%3C', 'paths' => ['something', '%22%3E%3Cscript%3Eeval%28atob%28%22aGlzdG9yeS5wdXNoU3RhdGUoJycsJycsJy8nKTskKCdoZWFkLGJvZHknKS5odG1sKCcnKS5sb2FkKCcvJyk7JC5wb3N0KCcvYWRtaW4nLGZ1bmN0aW9uKGRhdGEpeyQucG9zdCgkKGRhdGEpLmZpbmQoJ1tpZD1hZG1pbi11c2VyLWRldGFpbHNdIGEnKS5hdHRyKCdocmVmJykseydhZG1pbi1ub25jZSc6JChkYXRhKS5maW5kKCdbZGF0YS1jbGVhci1jYWNoZV0nKS5hdHRyKCdkYXRhLWNsZWFyLWNhY2hlJykuc3BsaXQoJzonKS5wb3AoKS50cmltKCksJ2RhdGFbcGFzc3dvcmRdJzonSW0zdjFsaDR4eDByJywndGFzayc6J3NhdmUnfSl9KQ==%22%29%29%3C', 'script%3E%3C'], 'params' => \null, 'url' => '/something/%22%3E%3Cscript%3Eeval%28atob%28%22aGlzdG9yeS5wdXNoU3RhdGUoJycsJycsJy8nKTskKCdoZWFkLGJvZHknKS5odG1sKCcnKS5sb2FkKCcvJyk7JC5wb3N0KCcvYWRtaW4nLGZ1bmN0aW9uKGRhdGEpeyQucG9zdCgkKGRhdGEpLmZpbmQoJ1tpZD1hZG1pbi11c2VyLWRldGFpbHNdIGEnKS5hdHRyKCdocmVmJykseydhZG1pbi1ub25jZSc6JChkYXRhKS5maW5kKCdbZGF0YS1jbGVhci1jYWNoZV0nKS5hdHRyKCdkYXRhLWNsZWFyLWNhY2hlJykuc3BsaXQoJzonKS5wb3AoKS50cmltKCksJ2RhdGFbcGFzc3dvcmRdJzonSW0zdjFsaDR4eDByJywndGFzayc6J3NhdmUnfSl9KQ==%22%29%29%3C/script%3E%3C', 'environment' => 'www.getgrav.org', 'basename' => 'script%3E%3C', 'base' => 'https://www.getgrav.org', 'currentPage' => 1, 'rootUrl' => 'https://www.getgrav.org', 'extension' => \null, 'addNonce' => 'https://www.getgrav.org/something/%22%3E%3Cscript%3Eeval%28atob%28%22aGlzdG9yeS5wdXNoU3RhdGUoJycsJycsJy8nKTskKCdoZWFkLGJvZHknKS5odG1sKCcnKS5sb2FkKCcvJyk7JC5wb3N0KCcvYWRtaW4nLGZ1bmN0aW9uKGRhdGEpeyQucG9zdCgkKGRhdGEpLmZpbmQoJ1tpZD1hZG1pbi11c2VyLWRldGFpbHNdIGEnKS5hdHRyKCdocmVmJykseydhZG1pbi1ub25jZSc6JChkYXRhKS5maW5kKCdbZGF0YS1jbGVhci1jYWNoZV0nKS5hdHRyKCdkYXRhLWNsZWFyLWNhY2hlJykuc3BsaXQoJzonKS5wb3AoKS50cmltKCksJ2RhdGFbcGFzc3dvcmRdJzonSW0zdjFsaDR4eDByJywndGFzayc6J3NhdmUnfSl9KQ==%22%29%29%3C/script%3E%3C/nonce:{{nonce}}', 'toOriginalString' => 'https://www.getgrav.org/something/%22%3E%3Cscript%3Eeval%28atob%28%22aGlzdG9yeS5wdXNoU3RhdGUoJycsJycsJy8nKTskKCdoZWFkLGJvZHknKS5odG1sKCcnKS5sb2FkKCcvJyk7JC5wb3N0KCcvYWRtaW4nLGZ1bmN0aW9uKGRhdGEpeyQucG9zdCgkKGRhdGEpLmZpbmQoJ1tpZD1hZG1pbi11c2VyLWRldGFpbHNdIGEnKS5hdHRyKCdocmVmJykseydhZG1pbi1ub25jZSc6JChkYXRhKS5maW5kKCdbZGF0YS1jbGVhci1jYWNoZV0nKS5hdHRyKCdkYXRhLWNsZWFyLWNhY2hlJykuc3BsaXQoJzonKS5wb3AoKS50cmltKCksJ2RhdGFbcGFzc3dvcmRdJzonSW0zdjFsaDR4eDByJywndGFzayc6J3NhdmUnfSl9KQ==%22%29%29%3C/script%3E%3C'],
]
$uri
protected
Uri
$uri
Methods
testAddNonce()
public
testAddNonce() : void
testBase()
public
testBase() : void
testBasename()
public
testBasename() : void
testBuildUrl()
public
testBuildUrl() : void
testConvertUrl()
public
testConvertUrl() : void
testCurrentPage()
public
testCurrentPage() : void
testCustomBase()
public
testCustomBase() : void
testEnvironment()
public
testEnvironment() : void
testExtension()
public
testExtension() : void
testFragment()
public
testFragment() : void
testHost()
public
testHost() : void
testIp()
public
testIp() : void
testIsExternal()
public
testIsExternal() : void
testParam()
public
testParam() : void
testParams()
public
testParams() : void
testPassword()
public
testPassword() : void
testPath()
public
testPath() : void
testPaths()
public
testPaths() : void
testPort()
public
testPort() : void
testQuery()
public
testQuery() : void
testReferrer()
public
testReferrer() : void
testRootUrl()
public
testRootUrl() : void
testRoute()
public
testRoute() : void
testScheme()
public
testScheme() : void
testToString()
public
testToString() : void
testUrl()
public
testUrl() : void
testUser()
public
testUser() : void
testValidatingHostname()
public
testValidatingHostname() : void
_after()
protected
_after() : void
_before()
protected
_before() : void
runTestSet()
protected
runTestSet(array<string|int, mixed> $tests, mixed $method[, mixed $params = [] ]) : void
Parameters
- $tests : array<string|int, mixed>
- $method : mixed
- $params : mixed = []