From 3dcb9b41f2cb451d858c31f2f080c070f0a78762 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 7 Feb 2007 16:10:39 +0000 Subject: [PATCH] - add pers. handles test --- tests/persistent_handles_001.phpt | 67 +++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 tests/persistent_handles_001.phpt 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 -- 2.30.2