From 4812fcbb3dc877ef54731bfc883fb3e5cb0e4c4b Mon Sep 17 00:00:00 2001 From: Phillip Davis Date: Thu, 22 Oct 2026 13:19:32 +0930 Subject: [PATCH] test: check that stream is a resource in testSendConnectionAborted If phpunit is run locally without having started a test server, then an error is reported from fread about stream being false. This change makes the result a bit nicer. If the fopen does not succeed then the test fails early and reports a hopefully-useful message. Signed-off-by: Phillip Davis --- tests/HTTP/SapiTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/HTTP/SapiTest.php b/tests/HTTP/SapiTest.php index 444832b..bde63d8 100644 --- a/tests/HTTP/SapiTest.php +++ b/tests/HTTP/SapiTest.php @@ -309,6 +309,7 @@ public function testSendConnectionAborted(): void $fetch_size = 6 * 1024 * 1024; $stream = fopen($url, 'r'); + self::assertIsResource($stream, "could not open $url - is the test server running?"); $size = 0; while ($size <= $fetch_size) {