mirror of
https://github.com/BushlanovDev/max-bot-api-client-php.git
synced 2026-10-09 13:28:21 +00:00
Added resumable upload tests
This commit is contained in:
@@ -446,6 +446,8 @@ class Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Uploads a file to the specified URL.
|
||||
*
|
||||
* @param string $uploadUrl The target URL for the upload.
|
||||
* @param resource $fileHandle A stream resource pointing to the file.
|
||||
* @param string $fileName The desired file name for the upload.
|
||||
|
||||
@@ -181,7 +181,9 @@ final readonly class Client implements ClientApiInterface
|
||||
while (!feof($fileResource)) {
|
||||
$chunk = fread($fileResource, $chunkSize);
|
||||
if ($chunk === false) {
|
||||
// @codeCoverageIgnoreStart
|
||||
throw new RuntimeException('Failed to read chunk from file stream.');
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
||||
$chunkLength = strlen($chunk);
|
||||
|
||||
Reference in New Issue
Block a user