From: Michael Wallner Date: Fri, 3 Jun 2005 09:18:55 +0000 (+0000) Subject: - bugs X-Git-Tag: RELEASE_0_8_0~5 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=147fb6c4b51fc83e0d0393ca6999e36a36908157;p=m6w6%2Fext-http - bugs --- diff --git a/tests/HttpRequest_002.phpt b/tests/HttpRequest_002.phpt index 5294150..669197e 100644 --- a/tests/HttpRequest_002.phpt +++ b/tests/HttpRequest_002.phpt @@ -1,7 +1,7 @@ --TEST-- -HttpRequest GET +HttpRequest GET/POST --SKIPIF-- - (int) PHP_VERSION) and die('skip PHP5 is required for Http classes'); ?> @@ -10,6 +10,11 @@ include 'skip.inc'; $r = new HttpRequest('http://www.google.com', HTTP_GET); var_dump($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(false != strstr($r->getResponseBody(), "Not Implemented")); ?> --EXPECTF-- Content-type: text/html @@ -43,3 +48,5 @@ Array [proxyauth_avail] => %d [num_connects] => %d ) +int(501) +bool(true) diff --git a/tests/HttpRequest_003.phpt b/tests/HttpRequest_003.phpt new file mode 100644 index 0000000..cd6edd0 --- /dev/null +++ b/tests/HttpRequest_003.phpt @@ -0,0 +1,18 @@ +--TEST-- +HttpRequest SSL +--SKIPIF-- + (int) PHP_VERSION) and die('skip PHP5 is required for Http classes'); +?> +--FILE-- +send(); +var_dump($r->getResponseBody()); +?> +--EXPECTF-- +Content-type: text/html +X-Powered-By: PHP/%s + +string(10) "1234567890" diff --git a/tests/split_response_001.phpt b/tests/split_response_001.phpt index 799e23a..95b8638 100644 --- a/tests/split_response_001.phpt +++ b/tests/split_response_001.phpt @@ -6,7 +6,9 @@ include 'skip.inc'; ?> --FILE-- --EXPECTF-- Content-type: text/html @@ -22,3 +24,5 @@ array ( ), 1 => 'Hallo Du!', ) +Done + diff --git a/tests/split_response_002.phpt b/tests/split_response_002.phpt new file mode 100644 index 0000000..820c1e6 --- /dev/null +++ b/tests/split_response_002.phpt @@ -0,0 +1,27 @@ +--TEST-- +http_split_response() list bug (mem-leaks) +--SKIPIF-- + +--FILE-- +r['headers'], $this->r['body']) = http_split_response($data); + } +} + +$t = new t; +$t->fail($data); +echo "Done\n"; +?> +--EXPECTF-- +Content-type: text/html +X-Powered-By: PHP/%s + +Done +