fix leaks / invalid frees
[m6w6/ext-http] / tests / url002.phpt
1 --TEST--
2 url properties
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 ?>
7 --FILE--
8 <?php
9 echo "Test\n";
10 $u = "http://user:pass@www.example.com:8080/path/file.ext".
11 "?foo=bar&more[]=1&more[]=2#hash";
12
13 var_dump($u === (string) new http\Url($u));
14
15 $url = new http\Url($u,
16 array("path" => "changed", "query" => "foo=&added=this"),
17 http\Url::JOIN_PATH |
18 http\Url::JOIN_QUERY |
19 http\Url::STRIP_AUTH |
20 http\Url::STRIP_FRAGMENT
21 );
22
23 var_dump($url->scheme);
24 var_dump($url->user);
25 var_dump($url->pass);
26 var_dump($url->host);
27 var_dump($url->port);
28 var_dump($url->path);
29 var_dump($url->query);
30 var_dump($url->fragment);
31
32 ?>
33 DONE
34 --EXPECT--
35 Test
36 bool(true)
37 string(4) "http"
38 NULL
39 NULL
40 string(15) "www.example.com"
41 int(8080)
42 string(13) "/path/changed"
43 string(38) "more%5B0%5D=1&more%5B1%5D=2&added=this"
44 NULL
45 DONE