From 76cc2d575b334a483efed5dc280c8811f8957d2f Mon Sep 17 00:00:00 2001 From: "v.scharf" Date: Mon, 13 Jul 2026 10:36:35 +0200 Subject: [PATCH] fix --- tests/acceptance/bootstrap/FeatureContext.php | 28 ++++++++++++++++ tests/acceptance/bootstrap/GraphContext.php | 1 - tests/acceptance/bootstrap/WebDav.php | 32 ------------------- 3 files changed, 28 insertions(+), 33 deletions(-) diff --git a/tests/acceptance/bootstrap/FeatureContext.php b/tests/acceptance/bootstrap/FeatureContext.php index 82746fc549..76f063b182 100644 --- a/tests/acceptance/bootstrap/FeatureContext.php +++ b/tests/acceptance/bootstrap/FeatureContext.php @@ -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 diff --git a/tests/acceptance/bootstrap/GraphContext.php b/tests/acceptance/bootstrap/GraphContext.php index 3ff3bbdc28..644684da41 100644 --- a/tests/acceptance/bootstrap/GraphContext.php +++ b/tests/acceptance/bootstrap/GraphContext.php @@ -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, diff --git a/tests/acceptance/bootstrap/WebDav.php b/tests/acceptance/bootstrap/WebDav.php index 3f3667ad0a..98216f12ff 100644 --- a/tests/acceptance/bootstrap/WebDav.php +++ b/tests/acceptance/bootstrap/WebDav.php @@ -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