* renaming tests
[m6w6/ext-http] / tests / HTTPi_Request_001.phpt
1 --TEST--
2 HTTPi_Request options
3 --SKIPIF--
4 <?php
5 include 'skip.inc';
6 (5 > (int) PHP_VERSION) and die('skip PHP5 is required for HTTPi');
7 ?>
8 --FILE--
9 <?php
10 $r1 = new HTTPi_Request;
11 $r2 = new HTTPi_Request;
12 $r1->setOptions(array('redirect'=>11, 'headers'=>array('X-Foo'=>'Bar')));
13 $r2->setOptions(array('redirect'=>99, 'headers'=>array('X-Bar'=>'Foo')));
14 $o1 = $r1->getOptions();
15 $o2 = $r2->getOptions();
16 $r1->setOptions($o2);
17 $r2->setOptions($o1);
18 print_r(array($o1, $o2));
19 var_dump(serialize($r1->getOptions()) === serialize($r2->getOptions()));
20 $r1 = null;
21 $r2 = null;
22 ?>
23 --EXPECTF--
24 Content-type: text/html
25 X-Powered-By: PHP/%s
26
27 Array
28 (
29 [0] => Array
30 (
31 [redirect] => 11
32 [headers] => Array
33 (
34 [X-Foo] => Bar
35 [X-Bar] => Foo
36 )
37
38 )
39
40 [1] => Array
41 (
42 [redirect] => 99
43 [headers] => Array
44 (
45 [X-Bar] => Foo
46 [X-Foo] => Bar
47 )
48
49 )
50
51 )
52 bool(false)