mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-07-13 17:12:05 -04:00
fix
This commit is contained in:
@@ -1341,6 +1341,34 @@ class FeatureContext extends BehatVariablesContext {
|
||||
$this->setResponse($this->sendingToWithDirectUrl($user, $verb, $endpoint));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $method
|
||||
* @param string $url
|
||||
* @param string $password
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
#[When('the public sends HTTP method :method to URL :url with password :password')]
|
||||
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
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $user
|
||||
|
||||
@@ -1576,7 +1576,6 @@ class GraphContext implements Context {
|
||||
* @throws GuzzleException
|
||||
* @throws Exception
|
||||
*/
|
||||
#[When('the administrator :user tries to add the following users to a group :group at once using the Graph API')]
|
||||
#[When('the administrator :user tries to add the following existent and nonexistent users to a group :group at once using the Graph API')]
|
||||
public function theAdministratorTriesToAddTheFollowingUsersToAGroupAtOnceUsingTheGraphApi(
|
||||
string $user,
|
||||
|
||||
@@ -757,38 +757,6 @@ trait WebDav {
|
||||
\sleep($time);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $password
|
||||
* @param string $fileName
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
#[Then('user :user using password :password should not be able to download file :fileName')]
|
||||
public function userUsingPasswordShouldNotBeAbleToDownloadFile(
|
||||
string $user,
|
||||
string $password,
|
||||
string $fileName
|
||||
): void {
|
||||
$user = $this->getActualUsername($user);
|
||||
$password = $this->getActualPassword($password);
|
||||
$response = $this->downloadFileAsUserUsingPassword($user, $fileName, $password);
|
||||
Assert::assertGreaterThanOrEqual(
|
||||
400,
|
||||
$response->getStatusCode(),
|
||||
__METHOD__
|
||||
. ' download must fail'
|
||||
);
|
||||
Assert::assertLessThanOrEqual(
|
||||
499,
|
||||
$response->getStatusCode(),
|
||||
__METHOD__
|
||||
. ' 4xx error expected but got status code "'
|
||||
. $response->getStatusCode() . '"'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $user
|
||||
|
||||
Reference in New Issue
Block a user