cvs: pecl /http/tests HttpRequest_002.phpt HttpRequest_003.phpt split_response_001.phpt split_response_002.phpt
| From: | Michael Wallner | Date: | Fri, 03 Jun 2005 09:18:56 +0000 |
| Subject: | cvs: pecl /http/tests HttpRequest_002.phpt HttpRequest_003.phpt split_response_001.phpt split_response_002.phpt | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-3223@lists.php.net to get a copy of this message | ||
mike Fri Jun 3 05:18:56 2005 EDT
Added files:
/pecl/http/tests HttpRequest_003.phpt split_response_002.phpt
Modified files:
/pecl/http/tests HttpRequest_002.phpt split_response_001.phpt
Log:
- bugs
http://cvs.php.net/diff.php/pecl/http/tests/HttpRequest_002.phpt?r1=1.1&r2=1.2&ty=u
Index: pecl/http/tests/HttpRequest_002.phpt
diff -u pecl/http/tests/HttpRequest_002.phpt:1.1 pecl/http/tests/HttpRequest_002.phpt:1.2
--- pecl/http/tests/HttpRequest_002.phpt:1.1 Tue Mar 22 14:20:18 2005
+++ pecl/http/tests/HttpRequest_002.phpt Fri Jun 3 05:18:55 2005
@@ -1,7 +1,7 @@
--TEST--
-HttpRequest GET
+HttpRequest GET/POST
--SKIPIF--
-<?php
+<?php
include 'skip.inc';
(5 > (int) PHP_VERSION) and die('skip PHP5 is required for Http classes');
?>
@@ -10,6 +10,11 @@
$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 @@
[proxyauth_avail] => %d
[num_connects] => %d
)
+int(501)
+bool(true)
http://cvs.php.net/diff.php/pecl/http/tests/split_response_001.phpt?r1=1.2&r2=1.3&ty=u
Index: pecl/http/tests/split_response_001.phpt
diff -u pecl/http/tests/split_response_001.phpt:1.2 pecl/http/tests/split_response_001.phpt:1.3
--- pecl/http/tests/split_response_001.phpt:1.2 Tue Apr 26 11:37:49 2005
+++ pecl/http/tests/split_response_001.phpt Fri Jun 3 05:18:55 2005
@@ -6,7 +6,9 @@
?>
--FILE--
<?php
-var_export(http_split_response("HTTP/1.1 200 Ok\r\nContent-Type:
text/plain\r\nContent-Language: de-AT\r\nDate: Sat, 22 Jan 2005 18:10:02 GMT\r\n\r\nHallo
Du!"));
+$data = "HTTP/1.1 200 Ok\r\nContent-Type: text/plain\r\nContent-Language: de-AT\r\nDate: Sat,
22 Jan 2005 18:10:02 GMT\r\n\r\nHallo Du!";
+var_export(http_split_response($data));
+echo "\nDone\n";
?>
--EXPECTF--
Content-type: text/html
@@ -22,3 +24,5 @@
),
1 => 'Hallo Du!',
)
+Done
+
http://cvs.php.net/co.php/pecl/http/tests/HttpRequest_003.phpt?r=1.1&p=1
Index: pecl/http/tests/HttpRequest_003.phpt
+++ pecl/http/tests/HttpRequest_003.phpt
--TEST--
HttpRequest SSL
--SKIPIF--
<?php
include 'skip.inc';
(5 > (int) PHP_VERSION) and die('skip PHP5 is required for Http classes');
?>
--FILE--
<?php
$r = new HttpRequest('https://ssl.arweb.info/iworks/data.txt');
$r->send();
var_dump($r->getResponseBody());
?>
--EXPECTF--
Content-type: text/html
X-Powered-By: PHP/%s
string(10) "1234567890"
http://cvs.php.net/co.php/pecl/http/tests/split_response_002.phpt?r=1.1&p=1
Index: pecl/http/tests/split_response_002.phpt
+++ pecl/http/tests/split_response_002.phpt
--TEST--
http_split_response() list bug (mem-leaks)
--SKIPIF--
<?php
include 'skip.inc';
?>
--FILE--
<?php
$data = "HTTP/1.1 200 Ok\r\nContent-Type: text/plain\r\nContent-Language: de-AT\r\nDate: Sat,
22 Jan 2005 18:10:02 GMT\r\n\r\nHallo Du!";
// this generates mem-leaks - no idea how to fix them
class t {
var $r = array();
function fail($data) {
list($this->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