X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2FHttpRequest_002.phpt;h=349f1faf38c752e4970fda9c31e7748dfa4493c6;hb=0d925a2820b9d75b8e32c451fd400863e51e22fe;hp=52941506cb8ba1cdc5b43690adc1a9833a6787da;hpb=244c8484720c23fdb5d9d557ca180dc2b822a140;p=m6w6%2Fext-http diff --git a/tests/HttpRequest_002.phpt b/tests/HttpRequest_002.phpt index 5294150..349f1fa 100644 --- a/tests/HttpRequest_002.phpt +++ b/tests/HttpRequest_002.phpt @@ -1,21 +1,27 @@ --TEST-- -HttpRequest GET +HttpRequest GET/POST --SKIPIF-- - (int) PHP_VERSION) and die('skip PHP5 is required for Http classes'); +checkver(5); +checkcls('HttpRequest'); +checkurl('www.google.com'); ?> --FILE-- send()); +$r->send(); print_r($r->getResponseInfo()); +$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 - -bool(true) +%sTEST Array ( [effective_url] => http://www.google.com/ @@ -40,6 +46,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) +