X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=tests%2Fskipif.inc;h=770cf5d32acb9d769d9bf23693fc584270a858c8;hp=4b2627a9c4436e0f720f6ccbb3e0503edc746911;hb=9f18b5395f9c937105d698ce564920dc06dce8f5;hpb=be9585b914061f84c5d5939673d29ecc048ab1d7 diff --git a/tests/skipif.inc b/tests/skipif.inc index 4b2627a..770cf5d 100644 --- a/tests/skipif.inc +++ b/tests/skipif.inc @@ -19,3 +19,15 @@ function skip_client_test($message = "skip need a client driver\n") { die($message); } } + +function skip_http2_test($message = "skip need http2 support (nghttpd in PATH)\n") { + if (defined("http\\Client\\Curl\\HTTP_VERSION_2_0") + && (http\Client\Curl\FEATURES & http\Client\Curl\Features\HTTP2)) { + foreach (explode(":", $_ENV["PATH"]) as $path) { + if (is_executable($path . "/nghttpd")) { + return; + } + } + } + die($message); +} \ No newline at end of file