From 147fb6c4b51fc83e0d0393ca6999e36a36908157 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Fri, 3 Jun 2005 09:18:55 +0000 Subject: [PATCH] - bugs --- tests/HttpRequest_002.phpt | 11 +++++++++-- tests/HttpRequest_003.phpt | 18 ++++++++++++++++++ tests/split_response_001.phpt | 6 +++++- tests/split_response_002.phpt | 27 +++++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 tests/HttpRequest_003.phpt create mode 100644 tests/split_response_002.phpt 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 + -- 2.30.2