This commit is contained in:
v.scharf
2026-07-13 10:36:35 +02:00
parent 63eed53bfb
commit 76cc2d575b
3 changed files with 28 additions and 33 deletions

View File

@@ -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

View File

@@ -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,

View File

@@ -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