fix tests for master
[m6w6/ext-http] / tests / skipif.inc
index cceeaf077e82820daeea9e84423986ac1524177a..770cf5d32acb9d769d9bf23693fc584270a858c8 100644 (file)
@@ -21,9 +21,12 @@ function skip_client_test($message = "skip need a client driver\n") {
 }
 
 function skip_http2_test($message = "skip need http2 support (nghttpd in PATH)\n") {
-       foreach (explode(":", $_ENV["PATH"]) as $path) {
-               if (is_executable($path . "/nghttpd")) {
-                       return;
+       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);