mirror of
https://github.com/BushlanovDev/max-bot-api-client-php.git
synced 2026-08-18 04:02:54 +00:00
Added resumable upload tests
This commit is contained in:
+6
-1
@@ -2053,6 +2053,8 @@ final class ApiTest extends TestCase
|
||||
}
|
||||
|
||||
#[Test]
|
||||
#[RunInSeparateProcess]
|
||||
#[PreserveGlobalState(false)]
|
||||
public function uploadFileUsesMultipartForSmallFiles(): void
|
||||
{
|
||||
$uploadUrl = 'https://upload.server/path';
|
||||
@@ -2085,6 +2087,8 @@ final class ApiTest extends TestCase
|
||||
}
|
||||
|
||||
#[Test]
|
||||
#[RunInSeparateProcess]
|
||||
#[PreserveGlobalState(false)]
|
||||
public function uploadFileUsesResumableForLargeFiles(): void
|
||||
{
|
||||
$uploadUrl = 'https://upload.server/path';
|
||||
@@ -2116,6 +2120,8 @@ final class ApiTest extends TestCase
|
||||
}
|
||||
|
||||
#[Test]
|
||||
#[RunInSeparateProcess]
|
||||
#[PreserveGlobalState(false)]
|
||||
public function uploadFileThrowsExceptionWhenFstatFails(): void
|
||||
{
|
||||
$this->expectException(RuntimeException::class);
|
||||
@@ -2127,6 +2133,5 @@ final class ApiTest extends TestCase
|
||||
$fstatMock->expects($this->once())->with($fileHandle)->willReturn(false);
|
||||
|
||||
$this->api->uploadFile('http://a.b', $fileHandle, 'file.txt');
|
||||
fclose($fileHandle);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user