Merge branch 'v2.6.x'
[m6w6/ext-http] / tests / skipif.inc
index 4b2627a9c4436e0f720f6ccbb3e0503edc746911..4ab631e63d5b9b00b2e1be2c3efe174bfc3791bb 100644 (file)
@@ -19,3 +19,14 @@ 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")) {
+               foreach (explode(":", $_ENV["PATH"]) as $path) {
+                       if (is_executable($path . "/nghttpd")) {
+                               return;
+                       }
+               }
+       }
+       die($message);
+}
\ No newline at end of file