mirror of
https://github.com/owncloud/ocis
synced 2026-04-25 17:25:21 +02:00
test: refactor upload expired cli test scenario
Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user