fix tests
[m6w6/ext-http] / tests / HttpQueryString_004.phpt
1 --TEST--
2 HttpQueryString w/ objects
3 --SKIPIF--
4 <?php
5 include 'skip.inc';
6 checkmin("5.2.5");
7 ?>
8 --FILE--
9 <?php
10 echo "-TEST\n";
11 class test_props {
12 public $bar;
13 public $baz;
14 protected $dont_show;
15 private $dont_show2;
16 function __construct() {
17 $this->bar = (object) array("baz"=>1);
18 $this->dont_show = 'xxx';
19 $this->dont_show2 = 'zzz';
20 }
21 }
22 $foo = new test_props;
23 var_dump($q = new HttpQueryString(false, $foo));
24 $foo->bar->baz = 0;
25 var_dump($q->mod($foo));
26 echo "Done\n";
27 ?>
28 --EXPECTF--
29 %aTEST
30 object(HttpQueryString)#3 (2) {
31 ["queryArray%s]=>
32 array(1) {
33 ["bar"]=>
34 array(1) {
35 ["baz"]=>
36 int(1)
37 }
38 }
39 ["queryString%s]=>
40 string(14) "bar%5Bbaz%5D=1"
41 }
42 object(HttpQueryString)#4 (2) {
43 ["queryArray%s]=>
44 array(1) {
45 ["bar"]=>
46 array(1) {
47 ["baz"]=>
48 int(0)
49 }
50 }
51 ["queryString%s]=>
52 string(14) "bar%5Bbaz%5D=0"
53 }
54 Done