extend test coverage for replacing file with zero-byte file (tus upload) (#8105)

This commit is contained in:
Sawjan Gurung
2024-01-22 20:01:10 +05:45
committed by GitHub
parent 0d11932540
commit cb0090e840
3 changed files with 119 additions and 1 deletions
@@ -209,7 +209,8 @@ class TUSContext implements Context {
$client = new Client(
$this->featureContext->getBaseUrl(),
['verify' => false,
[
'verify' => false,
'headers' => $headers
]
);
@@ -230,6 +231,8 @@ class TUSContext implements Context {
if ($bytes !== null) {
$client->file($sourceFile, $destination)->createWithUpload($client->getKey(), $bytes);
} elseif (\filesize($sourceFile) === 0) {
$client->file($sourceFile, $destination)->createWithUpload($client->getKey(), 0);
} elseif ($noOfChunks === 1) {
$client->file($sourceFile, $destination)->upload();
} else {