X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Fhttp003.phpt;fp=tests%2Fhttp003.phpt;h=996f4d7f350bca6146e2a906c94bf07eedbe5186;hb=f6f642fe8923885b0ad25ca97be20a72fc9a539c;hp=0000000000000000000000000000000000000000;hpb=02b71ab2353c851f1cf7212523db2f1a325bd0f4;p=m6w6%2Fext-raphf diff --git a/tests/http003.phpt b/tests/http003.phpt new file mode 100644 index 0000000..996f4d7 --- /dev/null +++ b/tests/http003.phpt @@ -0,0 +1,77 @@ +--TEST-- +pecl/http-v2 - clean with id only +--SKIPIF-- + +--FILE-- +enqueue(new http\Client\Request("GET", "http://php.net")); +} while (count($c) < 3); + +unset($c); + +var_dump(raphf\stat_persistent_handles()); + +raphf\clean_persistent_handles(null, "php.net:80"); + +var_dump(raphf\stat_persistent_handles()); + +?> +Done +--EXPECTF-- +Test +object(stdClass)#%d (2) { + ["http\Client\Curl"]=> + array(1) { + ["php.net:80"]=> + array(2) { + ["used"]=> + int(0) + ["free"]=> + int(1) + } + } + ["http\Client\Curl\Request"]=> + array(1) { + ["php.net:80"]=> + array(2) { + ["used"]=> + int(0) + ["free"]=> + int(3) + } + } +} +object(stdClass)#%d (2) { + ["http\Client\Curl"]=> + array(1) { + ["php.net:80"]=> + array(2) { + ["used"]=> + int(0) + ["free"]=> + int(0) + } + } + ["http\Client\Curl\Request"]=> + array(1) { + ["php.net:80"]=> + array(2) { + ["used"]=> + int(0) + ["free"]=> + int(0) + } + } +} +Done