From 1b986c9d312881ce8fa451494c0c0fd82027a90a Mon Sep 17 00:00:00 2001 From: Dillard Blom Date: Mon, 12 Oct 2026 14:59:31 +0200 Subject: [PATCH] Test: no random_bytes(0) in the batched SFTP read test --- tests/Unit/Backend/SftpReadStreamTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Unit/Backend/SftpReadStreamTest.php b/tests/Unit/Backend/SftpReadStreamTest.php index bff6a4b..e152baa 100644 --- a/tests/Unit/Backend/SftpReadStreamTest.php +++ b/tests/Unit/Backend/SftpReadStreamTest.php @@ -234,7 +234,8 @@ class SftpReadStreamTest extends TestCase { public function testReadManyReadsSmallFilesInBatches(): void { $files = []; for ($i = 0; $i < 70; $i++) { - $files["/home/index/$i"] = random_bytes(random_int(0, 5000)); + // one empty file on purpose (random_bytes(0) throws) + $files["/home/index/$i"] = $i === 0 ? '' : random_bytes(random_int(1, 5000)); } $files['/home/index/big'] = random_bytes(600000); // more than one READ $sftp = new FakeSftpConnection($files);