- allow passing request options to the ctor
[m6w6/ext-http] / tests / HttpRequest_001.phpt
index 8e0d6fab06c112793b1019cfa3fdc1695d6d4265..cd6ae675a7eeba138f0d362728acac294ea9e2a8 100644 (file)
@@ -1,15 +1,16 @@
 --TEST--
 HttpRequest options
 --SKIPIF--
 --TEST--
 HttpRequest options
 --SKIPIF--
-<?php 
+<?php
 include 'skip.inc';
 include 'skip.inc';
-(5 > (int) PHP_VERSION) and die('skip PHP5 is required for Http classes');
+checkver(5);
+checkcls('HttpRequest');
 ?>
 --FILE--
 <?php
 ?>
 --FILE--
 <?php
-$r1 = new HttpRequest;
+echo "-TEST\n";
+$r1 = new HttpRequest(null, 0, array('redirect'=>11, 'headers'=>array('X-Foo'=>'Bar')));
 $r2 = new HttpRequest;
 $r2 = new HttpRequest;
-$r1->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();
 $r2->setOptions(array('redirect'=>99, 'headers'=>array('X-Bar'=>'Foo')));
 $o1 = $r1->getOptions();
 $o2 = $r2->getOptions();
@@ -21,9 +22,7 @@ $r1 = null;
 $r2 = null;
 ?>
 --EXPECTF--
 $r2 = null;
 ?>
 --EXPECTF--
-Content-type: text/html
-X-Powered-By: PHP/%s
-
+%sTEST
 Array
 (
     [0] => Array
 Array
 (
     [0] => Array
@@ -49,4 +48,4 @@ Array
         )
 
 )
         )
 
 )
-bool(false)
\ No newline at end of file
+bool(false)