added test for public user open file with /app/open endpoint

This commit is contained in:
Prajwol Amatya
2024-08-29 16:52:07 +05:45
parent 7047b416f0
commit 82a8682a60
2 changed files with 79 additions and 0 deletions
@@ -1281,6 +1281,34 @@ class FeatureContext extends BehatVariablesContext {
$this->setResponse($this->sendingToWithDirectUrl($user, $verb, $url));
}
/**
* @When the public sends HTTP method :method to URL :url with password :password
*
* @param string $method
* @param string $url
* @param string $password
*
* @return void
*/
public function thePublicSendsHttpMethodToUrlWithPassword(string $method, string $url, string $password): void {
$password = $this->getActualPassword($password);
$token = $this->shareNgGetLastCreatedLinkShareToken();
$fullUrl = $this->getBaseUrl() . $url;
$headers = [
'Public-Token' => $token
];
$this->setResponse(
HttpRequestHelper::sendRequest(
$fullUrl,
$this->getStepLineRef(),
$method,
"public",
$password,
$headers
)
);
}
/**
* @When /^user "([^"]*)" sends HTTP method "([^"]*)" to URL "([^"]*)" with headers$/
*