- fix builds and tests without libcurl linked in
[m6w6/ext-http] / tests / HttpRequest_002.phpt
index 669197eb23cd19cca8efcdfc1c0110156f870660..f6f0f7439e6f5797d1fb5a7742152e2577e93c92 100644 (file)
@@ -3,10 +3,13 @@ HttpRequest GET/POST
 --SKIPIF--
 <?php
 include 'skip.inc';
-(5 > (int) PHP_VERSION) and die('skip PHP5 is required for Http classes');
+checkver(5);
+checkcls('HttpRequest');
+checkurl('www.google.com');
 ?>
 --FILE--
 <?php
+echo "-TEST\n";
 $r = new HttpRequest('http://www.google.com', HTTP_GET);
 var_dump($r->send());
 print_r($r->getResponseInfo());
@@ -14,12 +17,11 @@ $r->setMethod(HTTP_POST);
 $r->addPostFields(array('q'=>'foobar','start'=>10));
 $r->send();
 var_dump($r->getResponseCode());
+var_dump($r->getResponseMessage()->getResponseCode());
 var_dump(false != strstr($r->getResponseBody(), "Not Implemented"));
 ?>
 --EXPECTF--
-Content-type: text/html
-X-Powered-By: PHP/%s
-
+%sTEST
 bool(true)
 Array
 (
@@ -45,8 +47,9 @@ Array
     [content_length_upload] => %d
     [content_type] => %s
     [httpauth_avail] => %d
-    [proxyauth_avail] => %d
-    [num_connects] => %d
+    [proxyauth_avail] => %s
 )
 int(501)
+int(501)
 bool(true)
+