Skip to content

Commit b0911cc

Browse files
committed
better skipif
1 parent 56fb717 commit b0911cc

File tree

5 files changed

+20
-9
lines changed

5 files changed

+20
-9
lines changed

ext/curl/tests/Caddyfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
localhost
77

8+
respond / "Caddy is up and running"
9+
810
# HTTP/2 Server Push
911
respond /serverpush "main response"
1012
respond /serverpush/pushed "pushed response"

ext/curl/tests/bug76675.phpt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ Bug #76675 (Segfault with H2 server push write/writeheader handlers)
44
curl
55
--SKIPIF--
66
<?php
7-
if (!@fsockopen("localhost", 443, $errno, $errstr, 0.5)) {
8-
die("skip test needs Caddy");
9-
}
7+
include 'skipif-nocaddy.inc';
8+
109
$curl_version = curl_version();
1110
if ($curl_version['version_number'] < 0x073d00) {
1211
exit("skip: test may crash with curl < 7.61.0");

ext/curl/tests/bug77535.phpt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ Bug #77535 (Invalid callback, h2 server push)
44
curl
55
--SKIPIF--
66
<?php
7-
if (!@fsockopen("localhost", 443, $errno, $errstr, 0.5)) {
8-
die("skip test needs Caddy");
9-
}
7+
include 'skipif-nocaddy.inc';
8+
109
$curl_version = curl_version();
1110
if ($curl_version['version_number'] < 0x073d00) {
1211
exit("skip: test may crash with curl < 7.61.0");

ext/curl/tests/curl_pushfunction.phpt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ Kévin Dunglas
77
curl
88
--SKIPIF--
99
<?php
10-
if (!@fsockopen("localhost", 443, $errno, $errstr, 0.5)) {
11-
die("skip test needs Caddy");
12-
}
10+
include 'skipif-nocaddy.inc';
11+
1312
$curl_version = curl_version();
1413
if ($curl_version['version_number'] < 0x073d00) {
1514
exit("skip: test may crash with curl < 7.61.0");

ext/curl/tests/skipif-nocaddy.inc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
$ch = curl_init("https://localhost");
4+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
5+
6+
$body = curl_exec($ch);
7+
8+
curl_close($ch);
9+
10+
if ($body !== "Caddy is up and running") {
11+
die("skip test needs Caddy");
12+
}

0 commit comments

Comments
 (0)