test: refactor upload expired cli test scenario

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
This commit is contained in:
Saw-jan
2025-06-12 17:41:44 +05:45
parent 9fc043abc5
commit b64384a205
6 changed files with 114 additions and 29 deletions

View File

@@ -4838,4 +4838,24 @@ trait WebDav {
$response
);
}
/**
* @Given a file :name with the size of :size has been created locally
*
* @param string $name
* @param string $size (e.g.: 10MB, 100KB, 1GB)
*
* @return void
* @throws InvalidArgumentException
*/
public function aFileWithSizeHasBeenCreatedLocally(string $name, string $size): void {
$fullPath = UploadHelper::getUploadFilesDir($name);
if (\file_exists($fullPath)) {
throw new InvalidArgumentException(
__METHOD__ . " could not create '$fullPath'. File already exists."
);
}
UploadHelper::createFileSpecificSize($fullPath, $size);
$this->createdFiles[] = $fullPath;
}
}