test: add tests to check file uploads with same mtime

This commit is contained in:
Saw-jan
2024-11-21 10:04:31 +05:45
parent 9a7c8a43f8
commit 7c1c9ddacc
8 changed files with 94 additions and 10 deletions
+31
View File
@@ -398,6 +398,37 @@ class TUSContext implements Context {
\unlink($temporaryFileName);
}
/**
* @Given user :user has uploaded file :source to :destination with mtime :mtime using the TUS protocol
*
* @param string $user
* @param string $source
* @param string $destination
* @param string $mtime Time in human-readable format is taken as input which is converted into milliseconds that is used by API
*
* @return void
* @throws Exception
* @throws GuzzleException
*/
public function userHasUploadedFileWithMtimeUsingTUS(
string $user,
string $source,
string $destination,
string $mtime
): void {
$mtime = new DateTime($mtime);
$mtime = $mtime->format('U');
$user = $this->featureContext->getActualUsername($user);
$this->uploadFileUsingTus(
$user,
$source,
$destination,
null,
['mtime' => $mtime]
);
$this->featureContext->setLastUploadDeleteTime(\time());
}
/**
* @When user :user uploads file :source to :destination with mtime :mtime using the TUS protocol on the WebDAV API
*