test: check activities after deleting 0 byte file using file-id

This commit is contained in:
pradip
2025-05-30 13:04:30 +05:45
parent 97a65d4ca8
commit 550acd6af8
3 changed files with 142 additions and 0 deletions

View File

@@ -4716,4 +4716,40 @@ trait WebDav {
$this->setResponse($response);
$this->pushToLastStatusCodesArrays();
}
/**
* @Given user :user has deleted file :filename from space :space using file-id :fileId
*
* @param string $user
* @param string $filename
* @param string $space
* @param string $fileId
*
* @return void
* @throws JsonException
* @throws GuzzleException
*/
public function userHasDeletedFileFromSpaceUsingFileId(
string $user,
string $filename,
string $space,
string $fileId
): void {
$baseUrl = $this->getBaseUrl();
$davPath = WebDavHelper::getDavPath($this->getDavPathVersion());
$user = $this->getActualUsername($user);
$password = $this->getPasswordForUser($user);
$fullUrl = "$baseUrl/$davPath/$fileId";
$response = HttpRequestHelper::sendRequest(
$fullUrl,
'DELETE',
$user,
$password
);
$this->theHTTPStatusCodeShouldBe(
["204"],
"HTTP status code was not 204 while trying to delete resource '$filename' for user '$user'",
$response
);
}
}