From: Michael Wallner Date: Mon, 17 Nov 2014 16:52:46 +0000 (+0100) Subject: simplify test results X-Git-Tag: release-1.1.0~10 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=f6bcdde50a4ae9f9d1049ac647413d47c5c45961;p=m6w6%2Fext-raphf simplify test results --- diff --git a/tests/http001.phpt b/tests/http001.phpt index a28d8e1..e79f5b4 100644 --- a/tests/http001.phpt +++ b/tests/http001.phpt @@ -13,24 +13,27 @@ if (!class_exists("http\\Client", false)) { enqueue(new http\Client\Request("GET", "http://php.net")); } while (count($c) < 3); -var_dump(raphf\stat_persistent_handles()); +$h = (array) raphf\stat_persistent_handles(); +var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h))))); unset($c); -var_dump(raphf\stat_persistent_handles()); +$h = (array) raphf\stat_persistent_handles(); +var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h))))); ?> Done --EXPECTF-- Test -object(stdClass)#%d (2) { +array(2) { ["http\Client\Curl"]=> array(0) { } @@ -38,7 +41,7 @@ object(stdClass)#%d (2) { array(0) { } } -object(stdClass)#%d (2) { +array(2) { ["http\Client\Curl"]=> array(1) { ["php.net:80"]=> @@ -60,7 +63,7 @@ object(stdClass)#%d (2) { } } } -object(stdClass)#%d (2) { +array(2) { ["http\Client\Curl"]=> array(1) { ["php.net:80"]=> diff --git a/tests/http002.phpt b/tests/http002.phpt index 99d7260..505adc5 100644 --- a/tests/http002.phpt +++ b/tests/http002.phpt @@ -20,18 +20,21 @@ do { unset($c); -var_dump(raphf\stat_persistent_handles()); +$h = (array) raphf\stat_persistent_handles(); +var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h))))); + raphf\clean_persistent_handles("http\\Client\\Curl"); raphf\clean_persistent_handles("http\\Client\\Curl\\Request", "php.net:80"); -var_dump(raphf\stat_persistent_handles()); +$h = (array) raphf\stat_persistent_handles(); +var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h))))); ?> Done --EXPECTF-- Test -object(stdClass)#%d (2) { +array(2) { ["http\Client\Curl"]=> array(1) { ["php.net:80"]=> @@ -53,7 +56,7 @@ object(stdClass)#%d (2) { } } } -object(stdClass)#%d (2) { +array(2) { ["http\Client\Curl"]=> array(0) { } diff --git a/tests/http003.phpt b/tests/http003.phpt index 996f4d7..50dbb1c 100644 --- a/tests/http003.phpt +++ b/tests/http003.phpt @@ -20,17 +20,19 @@ do { unset($c); -var_dump(raphf\stat_persistent_handles()); +$h = (array) raphf\stat_persistent_handles(); +var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h))))); raphf\clean_persistent_handles(null, "php.net:80"); -var_dump(raphf\stat_persistent_handles()); +$h = (array) raphf\stat_persistent_handles(); +var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h))))); ?> Done --EXPECTF-- Test -object(stdClass)#%d (2) { +array(2) { ["http\Client\Curl"]=> array(1) { ["php.net:80"]=> @@ -52,7 +54,7 @@ object(stdClass)#%d (2) { } } } -object(stdClass)#%d (2) { +array(2) { ["http\Client\Curl"]=> array(1) { ["php.net:80"]=> diff --git a/tests/http004.phpt b/tests/http004.phpt index 0c47c7b..7077cbd 100644 --- a/tests/http004.phpt +++ b/tests/http004.phpt @@ -13,7 +13,8 @@ if (!class_exists("http\\Client", false)) { enqueue(new http\Client\Request("GET", "http://php.net")); } while (count($c) < 3); -var_dump(raphf\stat_persistent_handles()); +$h = (array) raphf\stat_persistent_handles(); +var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h))))); unset($c); -var_dump(raphf\stat_persistent_handles()); +$h = (array) raphf\stat_persistent_handles(); +var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h))))); raphf\clean_persistent_handles(); -var_dump(raphf\stat_persistent_handles()); +$h = (array) raphf\stat_persistent_handles(); +var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h))))); ?> Done --EXPECTF-- Test -object(stdClass)#%d (2) { +array(2) { ["http\Client\Curl"]=> array(0) { } @@ -44,7 +48,7 @@ object(stdClass)#%d (2) { array(0) { } } -object(stdClass)#%d (2) { +array(2) { ["http\Client\Curl"]=> array(1) { ["php.net:80"]=> @@ -66,7 +70,7 @@ object(stdClass)#%d (2) { } } } -object(stdClass)#%d (2) { +array(2) { ["http\Client\Curl"]=> array(1) { ["php.net:80"]=> @@ -88,7 +92,7 @@ object(stdClass)#%d (2) { } } } -object(stdClass)#%d (2) { +array(2) { ["http\Client\Curl"]=> array(1) { ["php.net:80"]=>