From db5299a8b005bf625b4e34666b48e6cce8990482 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 26 Sep 2007 06:18:00 +0000 Subject: [PATCH] - fixup tests --- tests/build_url_003.phpt | 1 + tests/match_request_header_001.phpt | 1 + tests/negotiation_001.phpt | 1 + tests/ob_deflatehandler_001.phpt | 1 + tests/parse_cookie_001.phpt | 2 +- tests/parse_cookie_002.phpt | 1 + tests/parse_message_001.phpt | 3 ++- tests/parse_message_004.phpt | 8 ++++---- tests/parse_params_001.phpt | 12 ++++++------ tests/persistent_handles_002.phpt | 4 +++- tests/request_gzip.phpt | 2 +- tests/request_put_data.phpt | 5 ++++- tests/send_data_001.phpt | 1 + tests/send_data_002.phpt | 1 + tests/send_data_003.phpt | 1 + tests/send_data_004.phpt | 1 + tests/send_data_005.phpt | 1 + tests/send_data_006.phpt | 1 + tests/send_data_007.phpt | 1 + tests/send_data_008.phpt | 1 + tests/send_file_005.phpt | 1 + tests/send_file_006.phpt | 1 + tests/send_file_007.phpt | 1 + tests/send_ifrange_001.phpt | 1 + tests/send_ifrange_003.phpt | 1 + tests/stream_filters_001.phpt | 1 + 26 files changed, 40 insertions(+), 15 deletions(-) diff --git a/tests/build_url_003.phpt b/tests/build_url_003.phpt index cd9c0a3..cb2d84f 100644 --- a/tests/build_url_003.phpt +++ b/tests/build_url_003.phpt @@ -3,6 +3,7 @@ http_build_url() --SKIPIF-- --ENV-- HTTP_HOST=www.example.com diff --git a/tests/match_request_header_001.phpt b/tests/match_request_header_001.phpt index 2d0f47e..b832f34 100644 --- a/tests/match_request_header_001.phpt +++ b/tests/match_request_header_001.phpt @@ -3,6 +3,7 @@ http_match_request_header() --SKIPIF-- --ENV-- HTTP_FOO=bar diff --git a/tests/negotiation_001.phpt b/tests/negotiation_001.phpt index 3641455..89a8e49 100644 --- a/tests/negotiation_001.phpt +++ b/tests/negotiation_001.phpt @@ -3,6 +3,7 @@ negotiation --SKIPIF-- --ENV-- HTTP_ACCEPT=application/xml, application/xhtml+xml, text/html ; q = .8 diff --git a/tests/ob_deflatehandler_001.phpt b/tests/ob_deflatehandler_001.phpt index ba39581..2d7a059 100644 --- a/tests/ob_deflatehandler_001.phpt +++ b/tests/ob_deflatehandler_001.phpt @@ -4,6 +4,7 @@ ob_deflatehandler --ENV-- diff --git a/tests/parse_cookie_001.phpt b/tests/parse_cookie_001.phpt index d17c78d..a3dbe60 100644 --- a/tests/parse_cookie_001.phpt +++ b/tests/parse_cookie_001.phpt @@ -14,7 +14,7 @@ echo "Done\n"; ?> --EXPECTF-- %sTEST -object(stdClass)#%d (%d) { +object(stdClass)%s { ["cookies"]=> array(3) { ["name"]=> diff --git a/tests/parse_cookie_002.phpt b/tests/parse_cookie_002.phpt index 3aa38f2..f40c823 100644 --- a/tests/parse_cookie_002.phpt +++ b/tests/parse_cookie_002.phpt @@ -3,6 +3,7 @@ parse cookie --SKIPIF-- --FILE-- body; +$m = http_parse_message(http_get('http://www.google.com')); +echo $m->body; echo "Done\n"; --EXPECTF-- %sTEST diff --git a/tests/parse_message_004.phpt b/tests/parse_message_004.phpt index 653d083..759065c 100644 --- a/tests/parse_message_004.phpt +++ b/tests/parse_message_004.phpt @@ -31,7 +31,7 @@ echo "Done\n"; ?> --EXPECTF-- %sTEST -object(stdClass)#1 (7) { +object(stdClass)%s { ["type"]=> int(2) ["httpVersion"]=> @@ -50,7 +50,7 @@ object(stdClass)#1 (7) { ["body"]=> string(10) "1234567890" ["parentMessage"]=> - object(stdClass)#2 (7) { + object(stdClass)%s { ["type"]=> int(1) ["httpVersion"]=> @@ -69,7 +69,7 @@ object(stdClass)#1 (7) { ["body"]=> string(0) "" ["parentMessage"]=> - object(stdClass)#3 (7) { + object(stdClass)%s { ["type"]=> int(2) ["httpVersion"]=> @@ -88,7 +88,7 @@ object(stdClass)#1 (7) { ["body"]=> string(0) "" ["parentMessage"]=> - object(stdClass)#4 (7) { + object(stdClass)%s { ["type"]=> int(1) ["httpVersion"]=> diff --git a/tests/parse_params_001.phpt b/tests/parse_params_001.phpt index 1dc452e..dde2780 100644 --- a/tests/parse_params_001.phpt +++ b/tests/parse_params_001.phpt @@ -11,12 +11,12 @@ var_dump(http_parse_params('text/html; charset=iso-8859-1')); var_dump(http_parse_params('text/html; charset="iso-8859-1"')); var_dump(http_parse_params('attachment; filename="gol;got,a.ext"')); var_dump(http_parse_params('public, must-revalidate, max-age=0')); -var_dump(http_parse_params('a')->params[0]); -var_dump(http_parse_params('a=b')->params[0]); +$p = http_parse_params('a'); var_dump($p->params[0]); +$p = http_parse_params('a=b'); var_dump($p->params[0]); echo "Done\n"; --EXPECTF-- %sTEST -object(stdClass)#%d (%d) { +object(stdClass)%s { ["params"]=> array(2) { [0]=> @@ -28,7 +28,7 @@ object(stdClass)#%d (%d) { } } } -object(stdClass)#%d (%d) { +object(stdClass)%s { ["params"]=> array(2) { [0]=> @@ -40,7 +40,7 @@ object(stdClass)#%d (%d) { } } } -object(stdClass)#%d (%d) { +object(stdClass)%s { ["params"]=> array(2) { [0]=> @@ -52,7 +52,7 @@ object(stdClass)#%d (%d) { } } } -object(stdClass)#%d (%d) { +object(stdClass)%s { ["params"]=> array(3) { [0]=> diff --git a/tests/persistent_handles_002.phpt b/tests/persistent_handles_002.phpt index 6efa9cb..fb4c8fa 100644 --- a/tests/persistent_handles_002.phpt +++ b/tests/persistent_handles_002.phpt @@ -3,6 +3,7 @@ persistent handles --SKIPIF-- @@ -25,7 +26,8 @@ foreach (http_persistent_handles_count() as $provider => $idents) { http_get("http://www.google.com/", null, $info[]); echo "One free request handle within GLOBAL: "; -var_dump(http_persistent_handles_count()->http_request["GLOBAL"]["free"]); +$h = http_persistent_handles_count(); +var_dump($h->http_request["GLOBAL"]["free"]); echo "Reusing request handle: "; http_get("http://www.google.com/", null, $info[]); diff --git a/tests/request_gzip.phpt b/tests/request_gzip.phpt index 4493d8c..7855a6f 100644 --- a/tests/request_gzip.phpt +++ b/tests/request_gzip.phpt @@ -15,7 +15,7 @@ var_dump(http_parse_message(http_get('http://dev.iworks.at/ext-http/.print_reque echo "Done\n"; --EXPECTF-- %sTEST -object(stdClass)#%d (%d) { +object(stdClass)%s { ["type"]=> int(2) ["httpVersion"]=> diff --git a/tests/request_put_data.phpt b/tests/request_put_data.phpt index be90a82..bd81a1e 100644 --- a/tests/request_put_data.phpt +++ b/tests/request_put_data.phpt @@ -9,7 +9,10 @@ skipif(!http_support(HTTP_SUPPORT_REQUESTS), "need request support"); CURLBUF_SIZE */)))->body); +$data = str_repeat("abc", 6000/* > CURLBUF_SIZE */); +$resp = http_put_data("http://dev.iworks.at/ext-http/.print_put.php5", $data); +$mess = http_parse_message($resp); +var_dump($data === $mess->body); echo "Done\n"; ?> diff --git a/tests/send_data_001.phpt b/tests/send_data_001.phpt index e5c6840..21c8d5c 100644 --- a/tests/send_data_001.phpt +++ b/tests/send_data_001.phpt @@ -4,6 +4,7 @@ http_send_data() NIL-NUM range --ENV-- HTTP_RANGE=bytes=-5 diff --git a/tests/send_data_002.phpt b/tests/send_data_002.phpt index af7e866..e178041 100644 --- a/tests/send_data_002.phpt +++ b/tests/send_data_002.phpt @@ -4,6 +4,7 @@ http_send_data() NUM-NUM range --ENV-- HTTP_RANGE=bytes=5-6 diff --git a/tests/send_data_003.phpt b/tests/send_data_003.phpt index c13ec80..06bc267 100644 --- a/tests/send_data_003.phpt +++ b/tests/send_data_003.phpt @@ -4,6 +4,7 @@ http_send_data() NUM-NIL range --ENV-- HTTP_RANGE=bytes=5981- diff --git a/tests/send_data_004.phpt b/tests/send_data_004.phpt index 6237a42..12223fd 100644 --- a/tests/send_data_004.phpt +++ b/tests/send_data_004.phpt @@ -4,6 +4,7 @@ http_send_data() syntactically invalid range --ENV-- HTTP_RANGE=bytes=123,-wtf ? diff --git a/tests/send_data_005.phpt b/tests/send_data_005.phpt index 28cbb78..4359efb 100644 --- a/tests/send_data_005.phpt +++ b/tests/send_data_005.phpt @@ -4,6 +4,7 @@ http_send_data() oversized range --ENV-- HTTP_RANGE=bytes=5990-6000 diff --git a/tests/send_data_006.phpt b/tests/send_data_006.phpt index 43d7a93..a8ab006 100644 --- a/tests/send_data_006.phpt +++ b/tests/send_data_006.phpt @@ -4,6 +4,7 @@ http_send_data() multiple ranges --ENV-- HTTP_RANGE=bytes=0-3, 4-5,9-11 diff --git a/tests/send_data_007.phpt b/tests/send_data_007.phpt index 91dedaa..a073661 100644 --- a/tests/send_data_007.phpt +++ b/tests/send_data_007.phpt @@ -4,6 +4,7 @@ http_send_data() NIL-NIL range --ENV-- HTTP_RANGE=bytes=0-0 diff --git a/tests/send_data_008.phpt b/tests/send_data_008.phpt index 7de621d..a3f1962 100644 --- a/tests/send_data_008.phpt +++ b/tests/send_data_008.phpt @@ -4,6 +4,7 @@ http_send_data() multiple ranges --ENV-- HTTP_RANGE=bytes=0-0,-1 diff --git a/tests/send_file_005.phpt b/tests/send_file_005.phpt index d6705ea..292df3c 100644 --- a/tests/send_file_005.phpt +++ b/tests/send_file_005.phpt @@ -4,6 +4,7 @@ http_send_file() multiple ranges --ENV-- HTTP_RANGE=bytes=0-3, 4-5,9-11 diff --git a/tests/send_file_006.phpt b/tests/send_file_006.phpt index e778805..925473e 100644 --- a/tests/send_file_006.phpt +++ b/tests/send_file_006.phpt @@ -4,6 +4,7 @@ http_send_file() first/last byte range --ENV-- HTTP_RANGE=bytes=0-0,-1 diff --git a/tests/send_file_007.phpt b/tests/send_file_007.phpt index 1ee12cc..47c4b24 100644 --- a/tests/send_file_007.phpt +++ b/tests/send_file_007.phpt @@ -4,6 +4,7 @@ http_send_file() NIL-NIL range --ENV-- HTTP_RANGE=bytes=0-0 diff --git a/tests/send_ifrange_001.phpt b/tests/send_ifrange_001.phpt index 9b36971..8f85abf 100644 --- a/tests/send_ifrange_001.phpt +++ b/tests/send_ifrange_001.phpt @@ -4,6 +4,7 @@ http_send() If-Range --ENV-- HTTP_RANGE=bytes=0-1 diff --git a/tests/send_ifrange_003.phpt b/tests/send_ifrange_003.phpt index 746d9c7..e3ea8ea 100644 --- a/tests/send_ifrange_003.phpt +++ b/tests/send_ifrange_003.phpt @@ -4,6 +4,7 @@ http_send() If-Range --ENV-- HTTP_RANGE=bytes=0-1 diff --git a/tests/stream_filters_001.phpt b/tests/stream_filters_001.phpt index 533b237..73fd567 100644 --- a/tests/stream_filters_001.phpt +++ b/tests/stream_filters_001.phpt @@ -3,6 +3,7 @@ stream filters --SKIPIF-- --FILE--