X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2FHTTPi_Request_001.phpt;fp=tests%2FHTTPi_Request_001.phpt;h=8ef846b94f97e994bc77351a54e6b3ffeeff7e24;hb=2d5d8aa343778897c7eedb25464a2cb0a789d748;hp=0000000000000000000000000000000000000000;hpb=5853f70523cc38387dc35e2e8b81f2b8b69f909b;p=m6w6%2Fext-http diff --git a/tests/HTTPi_Request_001.phpt b/tests/HTTPi_Request_001.phpt new file mode 100644 index 0000000..8ef846b --- /dev/null +++ b/tests/HTTPi_Request_001.phpt @@ -0,0 +1,52 @@ +--TEST-- +HTTPi_Request options +--SKIPIF-- + (int) PHP_VERSION) and die('skip PHP5 is required for HTTPi'); +?> +--FILE-- +setOptions(array('redirect'=>11, 'headers'=>array('X-Foo'=>'Bar'))); +$r2->setOptions(array('redirect'=>99, 'headers'=>array('X-Bar'=>'Foo'))); +$o1 = $r1->getOptions(); +$o2 = $r2->getOptions(); +$r1->setOptions($o2); +$r2->setOptions($o1); +print_r(array($o1, $o2)); +var_dump(serialize($r1->getOptions()) === serialize($r2->getOptions())); +$r1 = null; +$r2 = null; +?> +--EXPECTF-- +Content-type: text/html +X-Powered-By: PHP/%s + +Array +( + [0] => Array + ( + [redirect] => 11 + [headers] => Array + ( + [X-Foo] => Bar + [X-Bar] => Foo + ) + + ) + + [1] => Array + ( + [redirect] => 99 + [headers] => Array + ( + [X-Bar] => Foo + [X-Foo] => Bar + ) + + ) + +) +bool(false) \ No newline at end of file