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