Skip to content

Commit

Permalink
add tests to check activites of file after public edits it
Browse files Browse the repository at this point in the history
Signed-off-by: prashant-gurung899 <[email protected]>
  • Loading branch information
prashant-gurung899 committed Oct 1, 2024
1 parent d549f48 commit 77fb8af
Show file tree
Hide file tree
Showing 3 changed files with 502 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/acceptance/bootstrap/PublicWebDavContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,23 @@ public function deleteFileFromPublicShare(string $fileName, string $publicWebDAV
);
}

/**
* @Given /^the public has deleted (?:file|folder|entry) "([^"]*)" from the last public link share using the password "([^"]*)" and (old|new) public WebDAV API$/
*
* @param string $file
* @param string $password
* @param string $publicWebDAVAPIVersion
*
* @return void
*/
public function thePublicHasDeletedFileFromTheLastPublicLinkShareUsingThePasswordAndNewPublicWebdavApi(string $file, string $password, string $publicWebDAVAPIVersion): void {
if ($publicWebDAVAPIVersion === "old") {
return;
}
$response = $this->deleteFileFromPublicShare($file, $publicWebDAVAPIVersion, $password);
$this->featureContext->theHTTPStatusCodeShouldBe([201, 204], "", $response);
}

/**
* @When /^the public deletes (?:file|folder|entry) "([^"]*)" from the last public link share using the password "([^"]*)" and (old|new) public WebDAV API$/
*
Expand Down Expand Up @@ -554,6 +571,26 @@ public function publiclyUploadingContentWithPassword(
);
}

/**
* @Given /^the public has uploaded file "([^"]*)" with password "([^"]*)" and content "([^"]*)" using the (old|new) public WebDAV API$/
*
* @param string $filename
* @param string $password
* @param string $content
* @param string $publicWebDAVAPIVersion
*
* @return void
*/
public function thePublicHasUploadedFileWithPasswordAndContentUsingTheNewPublicWebdavApi(string $filename, string $password = '', string $content = 'test', string $publicWebDAVAPIVersion = "old"): void {
$response = $this->publiclyUploadingContentWithPassword(
$filename,
$password,
$content,
$publicWebDAVAPIVersion
);
$this->featureContext->theHTTPStatusCodeShouldBe([201, 204], "", $response);
}

/**
* @When /^the public uploads file "([^"]*)" with password "([^"]*)" and content "([^"]*)" using the (old|new) public WebDAV API$/
*
Expand Down
1 change: 1 addition & 0 deletions tests/acceptance/config/behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ default:
- FeatureContext: *common_feature_context_params
- SharingNgContext:
- GraphContext:
- PublicWebDavContext:

apiCollaboration:
paths:
Expand Down
Loading

0 comments on commit 77fb8af

Please sign in to comment.