fix for travis
[m6w6/ext-http] / tests / urlparser004.phpt
1 --TEST--
2 url parser multibyte/locale
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 if (!defined("http\\Url::PARSE_MBLOC") or
7 !stristr(setlocale(LC_CTYPE, NULL), "utf")) {
8 die("skip need http\\Url::PARSE_MBLOC support and LC_CTYPE=*.UTF-8");
9 }
10 ?>
11 --FILE--
12 <?php
13 echo "Test\n";
14
15 $urls = array(
16 "s\xc3\xa7heme:",
17 "s\xc3\xa7heme://h\xc6\x9fst",
18 "s\xc3\xa7heme://h\xc6\x9fst:23/päth/öf/fıle"
19 );
20
21 foreach ($urls as $url) {
22 printf("\n%s\n", $url);
23 var_dump(new http\Url($url, null, http\Url::PARSE_MBLOC));
24 }
25 ?>
26 DONE
27 --EXPECTF--
28 Test
29
30 sçheme:
31 object(http\Url)#%d (8) {
32 ["scheme"]=>
33 string(7) "sçheme"
34 ["user"]=>
35 NULL
36 ["pass"]=>
37 NULL
38 ["host"]=>
39 NULL
40 ["port"]=>
41 NULL
42 ["path"]=>
43 NULL
44 ["query"]=>
45 NULL
46 ["fragment"]=>
47 NULL
48 }
49
50 sçheme://hƟst
51 object(http\Url)#%d (8) {
52 ["scheme"]=>
53 string(7) "sçheme"
54 ["user"]=>
55 NULL
56 ["pass"]=>
57 NULL
58 ["host"]=>
59 string(5) "hƟst"
60 ["port"]=>
61 NULL
62 ["path"]=>
63 NULL
64 ["query"]=>
65 NULL
66 ["fragment"]=>
67 NULL
68 }
69
70 sçheme://hƟst:23/päth/öf/fıle
71 object(http\Url)#%d (8) {
72 ["scheme"]=>
73 string(7) "sçheme"
74 ["user"]=>
75 NULL
76 ["pass"]=>
77 NULL
78 ["host"]=>
79 string(5) "hƟst"
80 ["port"]=>
81 int(23)
82 ["path"]=>
83 string(16) "/päth/öf/fıle"
84 ["query"]=>
85 NULL
86 ["fragment"]=>
87 NULL
88 }
89 DONE