- Fixed build on php-trunk
[m6w6/ext-http] / tests / HttpRequest_001.phpt
1 --TEST--
2 HttpRequest options
3 --SKIPIF--
4 <?php
5 include 'skip.inc';
6 checkmin("5.2.5");
7 checkcls('HttpRequest');
8 ?>
9 --FILE--
10 <?php
11 echo "-TEST\n";
12 $r1 = new HttpRequest(null, 0, array('redirect'=>11, 'headers'=>array('X-Foo'=>'Bar')));
13 $r2 = new HttpRequest;
14 $r2->setOptions(array('redirect'=>99, 'headers'=>array('X-Bar'=>'Foo')));
15 $o1 = $r1->getOptions();
16 $o2 = $r2->getOptions();
17 $r1->setOptions($o2);
18 $r2->setOptions($o1);
19 print_r(array($o1, $o2));
20 var_dump(serialize($r1->getOptions()) === serialize($r2->getOptions()));
21 $r1 = null;
22 $r2 = null;
23 ?>
24 --EXPECTF--
25 %aTEST
26 Array
27 (
28 [0] => Array
29 (
30 [headers] => Array
31 (
32 [X-Foo] => Bar
33 [X-Bar] => Foo
34 )
35
36 [redirect] => 11
37 )
38
39 [1] => Array
40 (
41 [headers] => Array
42 (
43 [X-Bar] => Foo
44 [X-Foo] => Bar
45 )
46
47 [redirect] => 99
48 )
49
50 )
51 bool(false)