From 65cf6ca09489451473d9aba81f22895058403ca8 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Fri, 20 Apr 2007 09:27:24 +0000 Subject: [PATCH] - fix tests --- tests/HttpRequestDataShare_001.phpt | 1 + tests/HttpRequestDataShare_002.phpt | 1 + tests/HttpRequestPool_001.phpt | 12 ++---------- tests/HttpRequestPool_002.phpt | 6 ++---- tests/HttpRequest_002.phpt | 2 +- tests/HttpRequest_004.phpt | 2 +- tests/HttpRequest_006.phpt | 2 +- tests/HttpRequest_007.phpt | 13 ++++++------- tests/HttpRequest_008.phpt | 4 ++-- tests/HttpRequest_009.phpt | 2 +- tests/HttpRequest_010.phpt | 2 +- tests/request_cookies.phpt | 6 +++--- tests/request_gzip.phpt | 2 +- tests/request_put_data.phpt | 2 +- 14 files changed, 24 insertions(+), 33 deletions(-) diff --git a/tests/HttpRequestDataShare_001.phpt b/tests/HttpRequestDataShare_001.phpt index d1b18e8..cdbdc36 100644 --- a/tests/HttpRequestDataShare_001.phpt +++ b/tests/HttpRequestDataShare_001.phpt @@ -3,6 +3,7 @@ HttpRequestDataShare --SKIPIF-- --FILE-- diff --git a/tests/HttpRequestDataShare_002.phpt b/tests/HttpRequestDataShare_002.phpt index 1c7aa6f..4c61a79 100644 --- a/tests/HttpRequestDataShare_002.phpt +++ b/tests/HttpRequestDataShare_002.phpt @@ -3,6 +3,7 @@ HttpRequestDataShare global --SKIPIF-- --FILE-- diff --git a/tests/HttpRequestPool_001.phpt b/tests/HttpRequestPool_001.phpt index 1cfcfc8..4008e50 100644 --- a/tests/HttpRequestPool_001.phpt +++ b/tests/HttpRequestPool_001.phpt @@ -6,20 +6,16 @@ include 'skip.inc'; checkmin(5); checkcls('HttpRequestPool'); checkurl('www.php.net'); -checkurl('de.php.net'); -checkurl('at.php.net'); checkurl('dev.iworks.at'); ?> --FILE-- addPostFields(array('a'=>1,'b'=>2)) ; $pool = new HttpRequestPool( new HttpRequest('http://www.php.net/', HTTP_METH_HEAD), - new HttpRequest('http://at.php.net/', HTTP_METH_HEAD), - new HttpRequest('http://de.php.net/', HTTP_METH_HEAD), $post ); @@ -49,11 +45,7 @@ echo "Done\n"; --EXPECTF-- %sTEST http://www.php.net/=200:200 -http://at.php.net/=200:200 -http://de.php.net/=200:200 -http://dev.iworks.at/.print_request.php=200:200 -. -. +http://dev.iworks.at/ext-http/.print_request.php=200:200 . . Done diff --git a/tests/HttpRequestPool_002.phpt b/tests/HttpRequestPool_002.phpt index e15a756..94fd2c5 100644 --- a/tests/HttpRequestPool_002.phpt +++ b/tests/HttpRequestPool_002.phpt @@ -4,8 +4,6 @@ extending HttpRequestPool --FILE-- @@ -39,8 +37,8 @@ class MyPool extends HttpRequestPool $pool = new MyPool( new HttpRequest('http://www.php.net/', HTTP_METH_HEAD), - new HttpRequest('http://at.php.net/', HTTP_METH_HEAD), - new HttpRequest('http://de.php.net/', HTTP_METH_HEAD) + new HttpRequest('http://www.php.net/', HTTP_METH_HEAD), + new HttpRequest('http://www.php.net/', HTTP_METH_HEAD) ); $pool->send(); diff --git a/tests/HttpRequest_002.phpt b/tests/HttpRequest_002.phpt index a51f00b..5710d59 100644 --- a/tests/HttpRequest_002.phpt +++ b/tests/HttpRequest_002.phpt @@ -16,7 +16,7 @@ $r = new HttpRequest('http://www.google.com', HttpRequest::METH_GET); $r->send(); print_r($r->getResponseInfo()); -$r = new HttpRequest('http://dev.iworks.at/.print_request.php', HTTP_METH_POST); +$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_request.php', HTTP_METH_POST); $r->addCookies(array('MyCookie' => 'foobar')); $r->addQueryData(array('gq'=>'foobar','gi'=>10)); $r->addPostFields(array('pq'=>'foobar','pi'=>10)); diff --git a/tests/HttpRequest_004.phpt b/tests/HttpRequest_004.phpt index 4c253e0..dd710f0 100644 --- a/tests/HttpRequest_004.phpt +++ b/tests/HttpRequest_004.phpt @@ -15,7 +15,7 @@ $fields = array( ); echo "\nFirst Request\n"; -$r = new HttpRequest('http://dev.iworks.at/.print_request.php', HttpRequest::METH_POST); +$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_request.php', HttpRequest::METH_POST); $r->setPostFields($fields[0]); $r->addPostFields($fields[1]); var_dump($r->send()->getBody()); diff --git a/tests/HttpRequest_006.phpt b/tests/HttpRequest_006.phpt index 68c3ffe..24ee8a1 100644 --- a/tests/HttpRequest_006.phpt +++ b/tests/HttpRequest_006.phpt @@ -10,7 +10,7 @@ checkcls('HttpRequest'); setContentType('text/xml'); $r->setBody(xmlrpc_encode_request('testMethod', array('foo' => 'bar'))); var_dump($r->send()); diff --git a/tests/HttpRequest_007.phpt b/tests/HttpRequest_007.phpt index 1f31404..f440c83 100644 --- a/tests/HttpRequest_007.phpt +++ b/tests/HttpRequest_007.phpt @@ -9,7 +9,7 @@ checkcls('HttpRequest'); recordHistory = true; $r->addHeaders(array('content-type' => 'text/plain')); $r->setPutFile(__FILE__); @@ -19,18 +19,18 @@ echo "Done\n"; ?> --EXPECTF-- %sTEST -string(%d) "PUT /.print_put.php5 HTTP/1.1 +string(%d) "PUT /ext-http/.print_put.php5 HTTP/1.1 User-Agent: PECL::HTTP/%s Host: dev.iworks.at Accept: */* Content-Type: text/plain -Content-Length: 281 +Content-Length: %d Expect: 100-continue recordHistory = true; $r->addHeaders(array('content-type' => 'text/plain')); $r->setPutFile(__FILE__); @@ -45,14 +45,13 @@ Date: %s Server: %s X-Powered-By: %s Vary: Accept-Encoding +Content-Length: %d Content-Type: text/html -X-Original-Transfer-Encoding: chunked -Content-Length: 281 recordHistory = true; $r->addHeaders(array('content-type' => 'text/plain')); $r->setPutFile(__FILE__); diff --git a/tests/HttpRequest_008.phpt b/tests/HttpRequest_008.phpt index 7b32439..638d4c8 100644 --- a/tests/HttpRequest_008.phpt +++ b/tests/HttpRequest_008.phpt @@ -10,7 +10,7 @@ checkcls('HttpRequest'); echo "-TEST\n"; HttpRequest::methodRegister('foobar'); -$r = new HttpRequest('http://dev.iworks.at/.print_request.php', HttpRequest::METH_FOOBAR); +$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_request.php', HttpRequest::METH_FOOBAR); $r->setContentType('text/plain'); $r->setBody('Yep, this is FOOBAR!'); var_dump($r->send()->getResponseCode()); @@ -21,7 +21,7 @@ echo "Done\n"; --EXPECTF-- %sTEST int(200) -string(%d) "FOOBAR /.print_request.php HTTP/1.1 +string(%d) "FOOBAR /ext-http/.print_request.php HTTP/1.1 User-Agent: %s Host: dev.iworks.at Accept: */* diff --git a/tests/HttpRequest_009.phpt b/tests/HttpRequest_009.phpt index ead16d8..e74121a 100644 --- a/tests/HttpRequest_009.phpt +++ b/tests/HttpRequest_009.phpt @@ -22,7 +22,7 @@ class _R extends HttpRequest } } -$r = new _R('http://dev.iworks.at/.print_request.php', HTTP_METH_POST); +$r = new _R('http://dev.iworks.at/ext-http/.print_request.php', HTTP_METH_POST); $r->addPostFile('upload', __FILE__, 'text/plain'); $r->send(); diff --git a/tests/HttpRequest_010.phpt b/tests/HttpRequest_010.phpt index 13acd5f..10ec767 100644 --- a/tests/HttpRequest_010.phpt +++ b/tests/HttpRequest_010.phpt @@ -10,7 +10,7 @@ checkcls("HttpRequest"); send(); $c[0] = $r->getResponseInfo("cookies"); diff --git a/tests/request_cookies.phpt b/tests/request_cookies.phpt index 38428f3..8488b9d 100644 --- a/tests/request_cookies.phpt +++ b/tests/request_cookies.phpt @@ -12,7 +12,7 @@ echo "-TEST\n"; $cookies = array("name" => "val=ue"); -$r = new HttpRequest("http://dev.iworks.at/.print_request.php", HTTP_METH_GET, array("cookies" => $cookies)); +$r = new HttpRequest("http://dev.iworks.at/ext-http/.print_request.php", HTTP_METH_GET, array("cookies" => $cookies)); $r->recordHistory = true; $r->send(); $r->setOptions(array('encodecookies' => false)); @@ -23,7 +23,7 @@ echo "Done\n"; ?> --EXPECTF-- %sTEST -GET /.print_request.php HTTP/1.1 +GET /ext-http/.print_request.php HTTP/1.1 User-Agent: %s Host: dev.iworks.at Accept: */* @@ -36,7 +36,7 @@ Array [name] => val=ue ) -GET /.print_request.php HTTP/1.1 +GET /ext-http/.print_request.php HTTP/1.1 User-Agent: %s Host: dev.iworks.at Accept: */* diff --git a/tests/request_gzip.phpt b/tests/request_gzip.phpt index 6f78eda..4493d8c 100644 --- a/tests/request_gzip.phpt +++ b/tests/request_gzip.phpt @@ -10,7 +10,7 @@ skipif(!http_support(HTTP_SUPPORT_REQUESTS), 'need curl support'); true)))); +var_dump(http_parse_message(http_get('http://dev.iworks.at/ext-http/.print_request.php?gzip=1', array('compress' => true)))); echo "Done\n"; --EXPECTF-- diff --git a/tests/request_put_data.phpt b/tests/request_put_data.phpt index b8a5a3c..be90a82 100644 --- a/tests/request_put_data.phpt +++ b/tests/request_put_data.phpt @@ -9,7 +9,7 @@ skipif(!http_support(HTTP_SUPPORT_REQUESTS), "need request support"); CURLBUF_SIZE */)))->body); +var_dump(str_repeat("abc", 6000) === http_parse_message(http_put_data("http://dev.iworks.at/ext-http/.print_put.php5", str_repeat("abc", 6000/* > CURLBUF_SIZE */)))->body); echo "Done\n"; ?> -- 2.30.2