From: Michael Wallner Date: Wed, 7 Feb 2007 16:10:39 +0000 (+0000) Subject: - add pers. handles test X-Git-Tag: RELEASE_1_5_0_RC1~2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=3dcb9b41f2cb451d858c31f2f080c070f0a78762;p=m6w6%2Fext-http - add pers. handles test --- diff --git a/tests/persistent_handles_001.phpt b/tests/persistent_handles_001.phpt new file mode 100644 index 0000000..f5a6309 --- /dev/null +++ b/tests/persistent_handles_001.phpt @@ -0,0 +1,67 @@ +--TEST-- +persistent handles +--SKIPIF-- + +--INI-- +http.persistent.handles.ident=GLOBAL +--FILE-- +http_request["GLOBAL"]); +echo "Reusing request handle:\n"; +http_get("http://www.google.com/", null, $info[]); +var_dump($info[0]["pretransfer_time"] > 100 * $info[1]["pretransfer_time"], $info[0]["pretransfer_time"], $info[1]["pretransfer_time"]); +echo "Handles' been cleaned up:\n"; +#http_persistent_handles_clean(); +var_dump(http_persistent_handles_count()); +echo "Done\n"; +?> +--EXPECTF-- +%sTEST +No free handles: +object(stdClass)#%d (%d) { + ["http_request_pool"]=> + array(0) { + } + ["http_request"]=> + array(0) { + } + ["http_request_datashare"]=> + array(0) { + } + ["http_request_datashare_lock"]=> + array(0) { + } +} +One free request handle within GLOBAL: +int(1) +Reusing request handle: +bool(true) +float(%f) +float(%f) +Handles' been cleaned up: +object(stdClass)#%d (%d) { + ["http_request_pool"]=> + array(0) { + } + ["http_request"]=> + array(1) { + ["GLOBAL"]=> + int(1) + } + ["http_request_datashare"]=> + array(0) { + } + ["http_request_datashare_lock"]=> + array(0) { + } +} +Done