cd792f29688d894a7680498ad88da5534a83941a
[m6w6/ext-http] / tests / url001.phpt
1 --TEST--
2 url from env
3 --SKIPIF--
4 <? include "skippif.inc"; ?>
5 --ENV--
6 SERVER_PORT=55555
7 HTTP_HOST=example.com
8 --GET--
9 s=b&i=0&e=&a[]=1&a[]=2
10 --FILE--
11 <?php
12 printf("%s\n", new http\Url);
13 printf("%s\n", new http\Url("other", "index"));
14 printf("%s\n", new http\Url(array("scheme" => "https", "port" => 443)));
15 printf("%s\n", new http\Url(array("path" => "/./up/../down/../././//index.php/.", "query" => null), null, http\Url::SANITIZE_PATH|http\Url::FROM_ENV));
16 printf("%s\n", new http\Url(null, null, 0));
17 ?>
18 DONE
19 --EXPECTF--
20 http://example.com:55555/?s=b&i=0&e=&a[]=1&a[]=2
21 http://example.com:55555/index?s=b&i=0&e=&a[]=1&a[]=2
22 https://example.com/?s=b&i=0&e=&a[]=1&a[]=2
23 http://example.com:55555/index.php/
24 http://localhost/
25 DONE