Skip to content

Commit 2e6031d

Browse files
authored
Fix unseekable test (#391)
1 parent 13ad386 commit 2e6031d

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

test/ZipStreamTest.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,14 @@ public function testAddFileFromStreamUnseekableInputWithoutZeroHeader(): void
327327
defaultEnableZeroHeader: false,
328328
);
329329

330-
if (file_exists('/dev/null')) {
331-
$streamUnseekable = fopen('/dev/null', 'w+');
332-
} elseif (file_exists('NUL')) {
333-
$streamUnseekable = fopen('NUL', 'w+');
334-
} else {
330+
foreach (['cat', 'more'] as $cmd) {
331+
$streamUnseekable = @popen($cmd, 'w');
332+
if ($streamUnseekable !== false) {
333+
break;
334+
}
335+
}
336+
337+
if ($streamUnseekable === false) {
335338
$this->markTestSkipped('Needs file /dev/null');
336339
}
337340

0 commit comments

Comments
 (0)