fix tests
[m6w6/ext-http] / tests / urlparser012.phpt
1 --TEST--
2 url parser multibyte/locale/topct
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 if (!defined("http\\Url::PARSE_MBLOC") or
7 !defined("http\\Url::PARSE_TOIDN") or
8 !stristr(setlocale(LC_CTYPE, NULL), ".utf")) {
9 die("skip need http\\Url::PARSE_MBLOC|http\Url::PARSE_TOIDN support and LC_CTYPE=*.UTF-8");
10 }
11
12 ?>
13 --FILE--
14 <?php
15 echo "Test\n";
16
17 $urls = array(
18 "http://mike:paßwort@𐌀𐌁𐌂.it/for/€/?by=¢#ø"
19 );
20
21 foreach ($urls as $url) {
22 var_dump(new http\Url($url, null, http\Url::PARSE_MBLOC|http\Url::PARSE_TOPCT|http\Url::PARSE_TOIDN));
23 }
24 ?>
25 DONE
26 --EXPECTF--
27 Test
28 object(http\Url)#%d (8) {
29 ["scheme"]=>
30 string(4) "http"
31 ["user"]=>
32 string(4) "mike"
33 ["pass"]=>
34 string(12) "pa%C3%9Fwort"
35 ["host"]=>
36 string(13) "xn--097ccd.it"
37 ["port"]=>
38 NULL
39 ["path"]=>
40 string(15) "/for/%E2%82%AC/"
41 ["query"]=>
42 string(9) "by=%C2%A2"
43 ["fragment"]=>
44 string(6) "%C3%B8"
45 }
46 DONE