Annotation of embedaddon/php/ext/standard/tests/url/parse_url_basic_005.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Test parse_url() function: Parse a load of URLs without specifying PHP_URL_USER as the URL component 
        !             3: --FILE--
        !             4: <?php
        !             5: /* Prototype  : proto mixed parse_url(string url, [int url_component])
        !             6:  * Description: Parse a URL and return its components 
        !             7:  * Source code: ext/standard/url.c
        !             8:  * Alias to functions: 
        !             9:  */
        !            10: 
        !            11: /*
        !            12:  * Parse a load of URLs without specifying PHP_URL_USER as the URL component
        !            13:  */
        !            14: include_once(dirname(__FILE__) . '/urls.inc');
        !            15: 
        !            16: foreach ($urls as $url) {
        !            17:        echo "--> $url   : ";
        !            18:        var_dump(parse_url($url, PHP_URL_USER));
        !            19: }
        !            20: 
        !            21: echo "Done";
        !            22: ?>
        !            23: --EXPECTF--
        !            24: --> 64.246.30.37   : NULL
        !            25: --> http://64.246.30.37   : NULL
        !            26: --> http://64.246.30.37/   : NULL
        !            27: --> 64.246.30.37/   : NULL
        !            28: --> 64.246.30.37:80/   : NULL
        !            29: --> php.net   : NULL
        !            30: --> php.net/   : NULL
        !            31: --> http://php.net   : NULL
        !            32: --> http://php.net/   : NULL
        !            33: --> www.php.net   : NULL
        !            34: --> www.php.net/   : NULL
        !            35: --> http://www.php.net   : NULL
        !            36: --> http://www.php.net/   : NULL
        !            37: --> www.php.net:80   : NULL
        !            38: --> http://www.php.net:80   : NULL
        !            39: --> http://www.php.net:80/   : NULL
        !            40: --> http://www.php.net/index.php   : NULL
        !            41: --> www.php.net/?   : NULL
        !            42: --> www.php.net:80/?   : NULL
        !            43: --> http://www.php.net/?   : NULL
        !            44: --> http://www.php.net:80/?   : NULL
        !            45: --> http://www.php.net:80/index.php   : NULL
        !            46: --> http://www.php.net:80/foo/bar/index.php   : NULL
        !            47: --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php   : NULL
        !            48: --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2&parameters=3&too=4&here=5   : NULL
        !            49: --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/   : NULL
        !            50: --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php   : NULL
        !            51: --> http://www.php.net:80/this/../a/../deep/directory   : NULL
        !            52: --> http://www.php.net:80/this/../a/../deep/directory/   : NULL
        !            53: --> http://www.php.net:80/this/is/a/very/deep/directory/../file.php   : NULL
        !            54: --> http://www.php.net:80/index.php   : NULL
        !            55: --> http://www.php.net:80/index.php?   : NULL
        !            56: --> http://www.php.net:80/#foo   : NULL
        !            57: --> http://www.php.net:80/?#   : NULL
        !            58: --> http://www.php.net:80/?test=1   : NULL
        !            59: --> http://www.php.net/?test=1&   : NULL
        !            60: --> http://www.php.net:80/?&   : NULL
        !            61: --> http://www.php.net:80/index.php?test=1&   : NULL
        !            62: --> http://www.php.net/index.php?&   : NULL
        !            63: --> http://www.php.net:80/index.php?foo&   : NULL
        !            64: --> http://www.php.net/index.php?&foo   : NULL
        !            65: --> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI   : NULL
        !            66: --> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123   : NULL
        !            67: --> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123   : string(6) "secret"
        !            68: --> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123   : string(6) "secret"
        !            69: --> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123   : NULL
        !            70: --> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123   : string(6) "secret"
        !            71: --> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123   : string(14) "secret@hideout"
        !            72: --> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123   : string(6) "secret"
        !            73: --> nntp://news.php.net   : NULL
        !            74: --> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz   : NULL
        !            75: --> zlib:http://foo@bar   : NULL
        !            76: --> zlib:filename.txt   : NULL
        !            77: --> zlib:/path/to/my/file/file.txt   : NULL
        !            78: --> foo://foo@bar   : string(3) "foo"
        !            79: --> mailto:me@mydomain.com   : NULL
        !            80: --> /foo.php?a=b&c=d   : NULL
        !            81: --> foo.php?a=b&c=d   : NULL
        !            82: --> http://user:passwd@www.example.com:8080?bar=1&boom=0   : string(4) "user"
        !            83: --> file:///path/to/file   : NULL
        !            84: --> file://path/to/file   : NULL
        !            85: --> file:/path/to/file   : NULL
        !            86: --> http://1.2.3.4:/abc.asp?a=1&b=2   : NULL
        !            87: --> http://foo.com#bar   : NULL
        !            88: --> scheme:   : NULL
        !            89: --> foo+bar://baz@bang/bla   : string(3) "baz"
        !            90: --> gg:9130731   : NULL
        !            91: --> http://user:@pass@host/path?argument?value#etc   : string(4) "user"
        !            92: --> http://10.10.10.10/:80   : NULL
        !            93: --> http://x:?   : NULL
        !            94: --> x:blah.com   : NULL
        !            95: --> x:/blah.com   : NULL
        !            96: --> x://::abc/?   : bool(false)
        !            97: --> http://::?   : NULL
        !            98: --> x://::6.5   : NULL
        !            99: --> http://?:/   : NULL
        !           100: --> http://@?:/   : string(0) ""
        !           101: --> file:///:   : NULL
        !           102: --> file:///a:/   : NULL
        !           103: --> file:///ab:/   : NULL
        !           104: --> file:///a:/   : NULL
        !           105: --> file:///@:/   : NULL
        !           106: --> file:///:80/   : NULL
        !           107: --> []   : NULL
        !           108: --> http://[x:80]/   : NULL
        !           109: -->    : NULL
        !           110: --> /   : NULL
        !           111: --> http:///blah.com   : bool(false)
        !           112: --> http://:80   : bool(false)
        !           113: --> http://user@:80   : bool(false)
        !           114: --> http://user:pass@:80   : bool(false)
        !           115: --> http://:   : bool(false)
        !           116: --> http://@/   : bool(false)
        !           117: --> http://@:/   : bool(false)
        !           118: --> http://:/   : bool(false)
        !           119: --> http://?   : bool(false)
        !           120: --> http://?:   : bool(false)
        !           121: --> http://:?   : bool(false)
        !           122: --> http://blah.com:123456   : bool(false)
        !           123: --> http://blah.com:abcdef   : bool(false)
        !           124: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>