diff --git a/tests/TestHelpers/OcisHelper.php b/tests/TestHelpers/OcisHelper.php index 148c130492..85be2d7eec 100644 --- a/tests/TestHelpers/OcisHelper.php +++ b/tests/TestHelpers/OcisHelper.php @@ -33,13 +33,6 @@ use GuzzleHttp\Exception\GuzzleException; * @package TestHelpers */ class OcisHelper { - /** - * @return bool - */ - public static function isTestingOnOcis():bool { - return (\getenv("TEST_OCIS") === "true"); - } - /** * @return bool */ diff --git a/tests/acceptance/features/bootstrap/FeatureContext.php b/tests/acceptance/features/bootstrap/FeatureContext.php index be4a8fea01..914edb042f 100644 --- a/tests/acceptance/features/bootstrap/FeatureContext.php +++ b/tests/acceptance/features/bootstrap/FeatureContext.php @@ -2961,15 +2961,7 @@ class FeatureContext extends BehatVariablesContext { * @throws Exception */ public function theFileWithContentShouldExistInTheServerRoot(string $path, string $content): void { - if (OcisHelper::isTestingOnOcis()) { - $fileContent = $this->readFileInServerRootForOCIS($path); - } else { - $this->readFileInServerRootForCore($path); - $this->theHTTPStatusCodeShouldBe(200, 'Failed to read the file $path'); - $fileContent = $this->getResponseXml(); - $fileContent = (string)$fileContent->data->element->contentUrlEncoded; - $fileContent = \urldecode($fileContent); - } + $fileContent = $this->readFileInServerRootForOCIS($path); Assert::assertSame( $content, $fileContent, diff --git a/tests/acceptance/features/bootstrap/Provisioning.php b/tests/acceptance/features/bootstrap/Provisioning.php index 4164068a88..a3a1704b25 100644 --- a/tests/acceptance/features/bootstrap/Provisioning.php +++ b/tests/acceptance/features/bootstrap/Provisioning.php @@ -720,16 +720,15 @@ trait Provisioning { } if (isset($setting["email"])) { $entry['mail'] = $setting["email"]; - } elseif (OcisHelper::isTestingOnOcis()) { + } else { $entry['mail'] = $userId . '@owncloud.com'; } $entry['gidNumber'] = 5000; $entry['uidNumber'] = $uidNumber; - if (OcisHelper::isTestingOnOcis()) { - $entry['objectclass'][] = 'ownCloud'; - $entry['ownCloudUUID'] = WebDavHelper::generateUUIDv4(); - } + $entry['objectclass'][] = 'ownCloud'; + $entry['ownCloudUUID'] = WebDavHelper::generateUUIDv4(); + if (OcisHelper::isTestingParallelDeployment()) { $entry['ownCloudSelector'] = $this->getOCSelector(); } @@ -765,10 +764,9 @@ trait Provisioning { $entry['objectclass'][] = 'groupOfNames'; $entry['member'] = ""; } - if (OcisHelper::isTestingOnOcis()) { - $entry['objectclass'][] = 'ownCloud'; - $entry['ownCloudUUID'] = WebDavHelper::generateUUIDv4(); - } + $entry['objectclass'][] = 'ownCloud'; + $entry['ownCloudUUID'] = WebDavHelper::generateUUIDv4(); + $this->ldap->add($newDN, $entry); $this->ldapCreatedGroups[] = $group; } @@ -1108,12 +1106,6 @@ trait Provisioning { if ($skeleton) { $this->manuallyAddSkeletonFiles($usersAttributes); } - - if ($initialize && ($this->isEmptySkeleton() || !OcisHelper::isTestingOnOcis())) { - // We need to initialize each user using the individual authentication of each user. - // That is not possible in Guzzle6 batch mode. So we do it with normal requests in serial. - $this->initializeUsers($users); - } } /** @@ -2991,30 +2983,6 @@ trait Provisioning { $this->lastUploadTime = \time(); } - /** - * Touch an API end-point for each user so that their file-system gets setup - * - * @param array $users - * - * @return void - * @throws Exception - */ - public function initializeUsers(array $users):void { - $url = "/cloud/users/%s"; - foreach ($users as $user) { - $response = OcsApiHelper::sendRequest( - $this->getBaseUrl(), - $user, - $this->getPasswordForUser($user), - 'GET', - \sprintf($url, $user), - $this->getStepLineRef() - ); - $this->setResponse($response); - $this->theHTTPStatusCodeShouldBe(200); - } - } - /** * adds a user to the list of users that were created during test runs * makes it possible to use this list in other test steps @@ -3292,13 +3260,11 @@ trait Provisioning { } elseif (OcisHelper::isTestingWithGraphApi()) { $requestingUser = $this->getAdminUsername(); $requestingPassword = $this->getAdminPassword(); - } elseif (OcisHelper::isTestingOnOcis()) { + } else { $requestingUser = 'moss'; $requestingPassword = 'vista'; - } else { - $requestingUser = $this->getActualUsername($user); - $requestingPassword = $this->getPasswordForUser($requestingUser); } + $path = (OcisHelper::isTestingWithGraphApi()) ? "/graph/v1.0" : "/ocs/v2.php/cloud"; diff --git a/tests/acceptance/features/bootstrap/SearchContext.php b/tests/acceptance/features/bootstrap/SearchContext.php index 173c917586..466bfcff8e 100644 --- a/tests/acceptance/features/bootstrap/SearchContext.php +++ b/tests/acceptance/features/bootstrap/SearchContext.php @@ -59,9 +59,7 @@ class SearchContext implements Context { TableNode $properties = null ):void { // Because indexing of newly uploaded files or directories with ocis is decoupled and occurs asynchronously, a short wait is necessary before searching files or folders. - if (OcisHelper::isTestingOnOcis()) { - sleep(4); - } + sleep(4); $user = $this->featureContext->getActualUsername($user); $baseUrl = $this->featureContext->getBaseUrl(); $password = $this->featureContext->getPasswordForUser($user); diff --git a/tests/acceptance/features/bootstrap/WebDav.php b/tests/acceptance/features/bootstrap/WebDav.php index 7746a29571..fab76db9d4 100644 --- a/tests/acceptance/features/bootstrap/WebDav.php +++ b/tests/acceptance/features/bootstrap/WebDav.php @@ -5344,7 +5344,7 @@ trait WebDav { if ($multistatusResults !== null) { foreach ($multistatusResults as $multistatusResult) { $entryPath = $multistatusResult['value'][0]['value']; - if (OcisHelper::isTestingOnOcis() && $method === "REPORT") { + if ($method === "REPORT") { if ($entryNameToSearch !== null && str_ends_with($entryPath, $entryNameToSearch)) { return $multistatusResult; } else {