rebranding tests
This commit is contained in:
@@ -85,7 +85,7 @@ class CapabilitiesContext implements Context {
|
||||
* @throws Exception|GuzzleException
|
||||
*/
|
||||
public function getAdminUsernameForCapabilitiesCheck(): string {
|
||||
if (\TestHelpers\OcisHelper::isTestingOnReva()) {
|
||||
if (\TestHelpers\OcHelper::isTestingOnReva()) {
|
||||
// When testing on reva we don't have a user called "admin" to use
|
||||
// to access the capabilities. So create an ordinary user on-the-fly
|
||||
// with a default password. That user should be able to get a
|
||||
@@ -255,7 +255,7 @@ class CapabilitiesContext implements Context {
|
||||
$jsonExpectedDecoded['product'] = $product;
|
||||
$jsonExpectedDecoded['productname'] = $productName;
|
||||
|
||||
// We are on oCIS or reva or some other implementation. We cannot do "occ status".
|
||||
// We are on OpenCloud or reva or some other implementation. We cannot do "occ status".
|
||||
// So get the expected version values by looking in the capabilities response.
|
||||
$version = $this->getParameterValueFromXml(
|
||||
$responseXmlObject,
|
||||
|
||||
@@ -25,7 +25,7 @@ use Behat\Behat\Context\Context;
|
||||
use Behat\Gherkin\Node\TableNode;
|
||||
use PHPUnit\Framework\Assert;
|
||||
use TestHelpers\CliHelper;
|
||||
use TestHelpers\OcisConfigHelper;
|
||||
use TestHelpers\OcConfigHelper;
|
||||
use TestHelpers\BehatHelper;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
@@ -57,7 +57,7 @@ class CliContext implements Context {
|
||||
* @return void
|
||||
*/
|
||||
public function theAdministratorHasStoppedTheServer(): void {
|
||||
$response = OcisConfigHelper::stopOcis();
|
||||
$response = OcConfigHelper::stopOpencloud();
|
||||
$this->featureContext->theHTTPStatusCodeShouldBe(200, '', $response);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ class CliContext implements Context {
|
||||
* @return void
|
||||
*/
|
||||
public function theAdministratorHasStartedTheServer(): void {
|
||||
$response = OcisConfigHelper::startOcis();
|
||||
$response = OcConfigHelper::startOpencloud();
|
||||
$this->featureContext->theHTTPStatusCodeShouldBe(200, '', $response);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ use TestHelpers\CollaborationHelper;
|
||||
use TestHelpers\BehatHelper;
|
||||
|
||||
/**
|
||||
* steps needed to re-configure oCIS server
|
||||
* steps needed to re-configure OpenCloud server
|
||||
*/
|
||||
class CollaborationContext implements Context {
|
||||
private FeatureContext $featureContext;
|
||||
|
||||
@@ -43,7 +43,7 @@ class FavoritesContext implements Context {
|
||||
*
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function userFavoritesElement(string $user, string $path, string $spaceId = null): ResponseInterface {
|
||||
public function userFavoritesElement(string $user, string $path, ?string $spaceId = null): ResponseInterface {
|
||||
return $this->changeFavStateOfAnElement(
|
||||
$user,
|
||||
$path,
|
||||
@@ -180,7 +180,7 @@ class FavoritesContext implements Context {
|
||||
string $user,
|
||||
string $path,
|
||||
int $expectedValue = 1,
|
||||
string $spaceId = null
|
||||
?string $spaceId = null
|
||||
): void {
|
||||
$property = "oc:favorite";
|
||||
$this->webDavPropertiesContext->checkPropertyOfAFolder(
|
||||
|
||||
@@ -38,11 +38,11 @@ use Laminas\Ldap\Ldap;
|
||||
use TestHelpers\SetupHelper;
|
||||
use TestHelpers\HttpRequestHelper;
|
||||
use TestHelpers\HttpLogger;
|
||||
use TestHelpers\OcisHelper;
|
||||
use TestHelpers\OcHelper;
|
||||
use TestHelpers\GraphHelper;
|
||||
use TestHelpers\WebDavHelper;
|
||||
use TestHelpers\SettingsHelper;
|
||||
use TestHelpers\OcisConfigHelper;
|
||||
use TestHelpers\OcConfigHelper;
|
||||
use TestHelpers\BehatHelper;
|
||||
use Swaggest\JsonSchema\InvalidValue as JsonSchemaException;
|
||||
use Swaggest\JsonSchema\Exception\ArrayException;
|
||||
@@ -478,10 +478,10 @@ class FeatureContext extends BehatVariablesContext {
|
||||
$this->alternateAdminPassword = "IHave99LotsOfPriv";
|
||||
$this->publicLinkSharePassword = "publicPwd:1";
|
||||
|
||||
$this->baseUrl = OcisHelper::getServerUrl();
|
||||
$this->baseUrl = OcHelper::getServerUrl();
|
||||
$this->localBaseUrl = $this->baseUrl;
|
||||
// federated server url from the environment
|
||||
$this->remoteBaseUrl = OcisHelper::getFederatedServerUrl();
|
||||
$this->remoteBaseUrl = OcHelper::getFederatedServerUrl();
|
||||
|
||||
// get the admin username from the environment (if defined)
|
||||
$adminUsernameFromEnvironment = $this->getAdminUsernameFromEnvironment();
|
||||
@@ -617,10 +617,10 @@ class FeatureContext extends BehatVariablesContext {
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function startOcisServer(): void {
|
||||
$response = OcisConfigHelper::startOcis();
|
||||
public function startOpencloudServer(): void {
|
||||
$response = OcConfigHelper::startOpencloud();
|
||||
// 409 is returned if the server is already running
|
||||
$this->theHTTPStatusCodeShouldBe([200, 409], 'Starting oCIS server', $response);
|
||||
$this->theHTTPStatusCodeShouldBe([200, 409], 'Starting OpenCloud server', $response);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -727,7 +727,7 @@ class FeatureContext extends BehatVariablesContext {
|
||||
}
|
||||
|
||||
/**
|
||||
* removes the port from the ocis URL
|
||||
* removes the port from the OpenCloud URL
|
||||
*
|
||||
* @param string $url
|
||||
*
|
||||
@@ -751,13 +751,12 @@ class FeatureContext extends BehatVariablesContext {
|
||||
* @return string
|
||||
*/
|
||||
public function getStorageUsersRoot(): string {
|
||||
$ocisDataPath = getenv("OC_BASE_DATA_PATH") ? getenv("OC_BASE_DATA_PATH") : getenv("HOME") . '/.ocis';
|
||||
return getenv("STORAGE_USERS_OCIS_ROOT") ? getenv("STORAGE_USERS_OCIS_ROOT") : $ocisDataPath . "/storage/users";
|
||||
$ocDataPath = getenv("OC_BASE_DATA_PATH") ? getenv("OC_BASE_DATA_PATH") : getenv("HOME") . '/.opencloud';
|
||||
return getenv("STORAGE_USERS_OC_ROOT") ? getenv("STORAGE_USERS_OC_ROOT") : $ocDataPath . "/storage/users";
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the path of the base URL
|
||||
* e.g. owncloud-core/10 if the baseUrl is http://localhost/owncloud-core/10
|
||||
* the path is without a slash at the end and without a slash at the beginning
|
||||
*
|
||||
* @return string
|
||||
@@ -808,7 +807,7 @@ class FeatureContext extends BehatVariablesContext {
|
||||
* @return string
|
||||
*/
|
||||
public function getCollaborationHostName(): string {
|
||||
return $this->removeSchemeAndPortFromUrl(OcisHelper::getCollaborationServiceUrl());
|
||||
return $this->removeSchemeAndPortFromUrl(OcHelper::getCollaborationServiceUrl());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -868,7 +867,6 @@ class FeatureContext extends BehatVariablesContext {
|
||||
|
||||
/**
|
||||
* returns the base URL without any sub-path e.g. http://localhost:8080
|
||||
* of the base URL http://localhost:8080/owncloud
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -1516,7 +1514,7 @@ class FeatureContext extends BehatVariablesContext {
|
||||
* @return bool
|
||||
*/
|
||||
public function isAPublicLinkUrl(string $url): bool {
|
||||
if (OcisHelper::isTestingOnReva()) {
|
||||
if (OcHelper::isTestingOnReva()) {
|
||||
$urlEnding = \ltrim($url, '/');
|
||||
} else {
|
||||
if (\substr($url, 0, 4) !== "http") {
|
||||
@@ -1743,7 +1741,7 @@ class FeatureContext extends BehatVariablesContext {
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a directory under the server root on the ownCloud server
|
||||
* Make a directory under the server root on the OpenCloud server
|
||||
*
|
||||
* @param string $dirPathFromServerRoot e.g. 'apps2/myapp/appinfo'
|
||||
*
|
||||
@@ -2559,7 +2557,7 @@ class FeatureContext extends BehatVariablesContext {
|
||||
]
|
||||
);
|
||||
|
||||
if (!OcisHelper::isTestingOnReva()) {
|
||||
if (!OcHelper::isTestingOnReva()) {
|
||||
array_push(
|
||||
$substitutions,
|
||||
[
|
||||
|
||||
@@ -200,10 +200,10 @@ class GraphContext implements Context {
|
||||
public function editUserUsingTheGraphApi(
|
||||
string $byUser,
|
||||
string $user,
|
||||
string $userName = null,
|
||||
string $password = null,
|
||||
string $email = null,
|
||||
string $displayName = null,
|
||||
?string $userName = null,
|
||||
?string $password = null,
|
||||
?string $email = null,
|
||||
?string $displayName = null,
|
||||
bool $accountEnabled = true,
|
||||
string $method="PATCH"
|
||||
): ResponseInterface {
|
||||
@@ -2371,7 +2371,7 @@ class GraphContext implements Context {
|
||||
public function downloadedJsonContentShouldContainEventTypeInItemAndShouldMatch(
|
||||
string $eventType,
|
||||
?string $spaceType=null,
|
||||
PyStringNode $schemaString=null
|
||||
?PyStringNode $schemaString=null
|
||||
): void {
|
||||
$actualResponseToAssert = null;
|
||||
$events = $this->featureContext->getJsonDecodedResponseBodyContent()->events;
|
||||
|
||||
+12
-12
@@ -23,14 +23,14 @@
|
||||
use Behat\Behat\Context\Context;
|
||||
use Behat\Gherkin\Node\TableNode;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use TestHelpers\OcisConfigHelper;
|
||||
use TestHelpers\OcConfigHelper;
|
||||
use TestHelpers\GraphHelper;
|
||||
use PHPUnit\Framework\Assert;
|
||||
|
||||
/**
|
||||
* steps needed to re-configure oCIS server
|
||||
* steps needed to re-configure OpenCloud server
|
||||
*/
|
||||
class OcisConfigContext implements Context {
|
||||
class OcConfigContext implements Context {
|
||||
private array $enabledPermissionsRoles = [];
|
||||
|
||||
/**
|
||||
@@ -64,7 +64,7 @@ class OcisConfigContext implements Context {
|
||||
"POSTPROCESSING_DELAY" => $delayTime . "s",
|
||||
];
|
||||
|
||||
$response = OcisConfigHelper::reConfigureOcis($envs);
|
||||
$response = OcConfigHelper::reConfigureOc($envs);
|
||||
Assert::assertEquals(
|
||||
200,
|
||||
$response->getStatusCode(),
|
||||
@@ -86,7 +86,7 @@ class OcisConfigContext implements Context {
|
||||
$configVariable => $configValue,
|
||||
];
|
||||
|
||||
$response = OcisConfigHelper::reConfigureOcis($envs);
|
||||
$response = OcConfigHelper::reConfigureOc($envs);
|
||||
Assert::assertEquals(
|
||||
200,
|
||||
$response->getStatusCode(),
|
||||
@@ -111,7 +111,7 @@ class OcisConfigContext implements Context {
|
||||
$envs = [
|
||||
"GRAPH_AVAILABLE_ROLES" => implode(',', $defaultRoles),
|
||||
];
|
||||
$response = OcisConfigHelper::reConfigureOcis($envs);
|
||||
$response = OcConfigHelper::reConfigureOc($envs);
|
||||
Assert::assertEquals(
|
||||
200,
|
||||
$response->getStatusCode(),
|
||||
@@ -137,7 +137,7 @@ class OcisConfigContext implements Context {
|
||||
$envs = [
|
||||
"GRAPH_AVAILABLE_ROLES" => implode(',', $availableRoles),
|
||||
];
|
||||
$response = OcisConfigHelper::reConfigureOcis($envs);
|
||||
$response = OcConfigHelper::reConfigureOc($envs);
|
||||
Assert::assertEquals(
|
||||
200,
|
||||
$response->getStatusCode(),
|
||||
@@ -157,7 +157,7 @@ class OcisConfigContext implements Context {
|
||||
*/
|
||||
public function theConfigHasBeenSetPathTo(string $configVariable, string $path): void {
|
||||
$path = \dirname(__FILE__) . "/../../" . $path;
|
||||
$response = OcisConfigHelper::reConfigureOcis(
|
||||
$response = OcConfigHelper::reConfigureOc(
|
||||
[
|
||||
$configVariable => $path
|
||||
]
|
||||
@@ -183,7 +183,7 @@ class OcisConfigContext implements Context {
|
||||
$envs[$row['config']] = $row['value'];
|
||||
}
|
||||
|
||||
$response = OcisConfigHelper::reConfigureOcis($envs);
|
||||
$response = OcConfigHelper::reConfigureOc($envs);
|
||||
Assert::assertEquals(
|
||||
200,
|
||||
$response->getStatusCode(),
|
||||
@@ -196,12 +196,12 @@ class OcisConfigContext implements Context {
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function rollbackOcis(): void {
|
||||
$response = OcisConfigHelper::rollbackOcis();
|
||||
public function rollbackOc(): void {
|
||||
$response = OcConfigHelper::rollbackOc();
|
||||
Assert::assertEquals(
|
||||
200,
|
||||
$response->getStatusCode(),
|
||||
"Failed to rollback ocis server. Check if oCIS is started with ociswrapper."
|
||||
"Failed to rollback OpenCloud server. Check if OpenCloud is started with ocwrapper."
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ use Behat\Behat\Context\Context;
|
||||
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use TestHelpers\OcisHelper;
|
||||
use TestHelpers\OcHelper;
|
||||
use TestHelpers\OcmHelper;
|
||||
use TestHelpers\WebDavHelper;
|
||||
use TestHelpers\BehatHelper;
|
||||
@@ -125,7 +125,7 @@ class OcmContext implements Context {
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function acceptInvitation(string $user, string $token = null): ResponseInterface {
|
||||
public function acceptInvitation(string $user, ?string $token = null): ResponseInterface {
|
||||
$providerDomain = $this->featureContext->getLocalBaseUrlWithoutScheme();
|
||||
if ($this->featureContext->getCurrentServer() === "LOCAL") {
|
||||
$providerDomain = $this->featureContext->getRemoteBaseUrlWithoutScheme();
|
||||
|
||||
@@ -26,7 +26,7 @@ use Psr\Http\Message\ResponseInterface;
|
||||
use PHPUnit\Framework\Assert;
|
||||
use TestHelpers\UserHelper;
|
||||
use TestHelpers\HttpRequestHelper;
|
||||
use TestHelpers\OcisHelper;
|
||||
use TestHelpers\OcHelper;
|
||||
use TestHelpers\WebDavHelper;
|
||||
use TestHelpers\GraphHelper;
|
||||
use Laminas\Ldap\Exception\LdapException;
|
||||
@@ -52,8 +52,7 @@ trait Provisioning {
|
||||
private array $createdGroups = [];
|
||||
|
||||
/**
|
||||
* Check if this is the admin group. That group is always a local group in
|
||||
* ownCloud10, even if other groups come from LDAP.
|
||||
* Check if this is the admin group.
|
||||
*
|
||||
* @param string $groupname
|
||||
*
|
||||
@@ -315,15 +314,15 @@ trait Provisioning {
|
||||
* @throws \LdapException
|
||||
*/
|
||||
public function connectToLdap(array $suiteParameters): void {
|
||||
$this->ldapBaseDN = OcisHelper::getBaseDN();
|
||||
$this->ldapUsersOU = OcisHelper::getUsersOU();
|
||||
$this->ldapGroupsOU = OcisHelper::getGroupsOU();
|
||||
$this->ldapGroupSchema = OcisHelper::getGroupSchema();
|
||||
$this->ldapHost = OcisHelper::getHostname();
|
||||
$this->ldapPort = OcisHelper::getLdapPort();
|
||||
$useSsl = OcisHelper::useSsl();
|
||||
$this->ldapAdminUser = OcisHelper::getBindDN();
|
||||
$this->ldapAdminPassword = OcisHelper::getBindPassword();
|
||||
$this->ldapBaseDN = OcHelper::getBaseDN();
|
||||
$this->ldapUsersOU = OcHelper::getUsersOU();
|
||||
$this->ldapGroupsOU = OcHelper::getGroupsOU();
|
||||
$this->ldapGroupSchema = OcHelper::getGroupSchema();
|
||||
$this->ldapHost = OcHelper::getHostname();
|
||||
$this->ldapPort = OcHelper::getLdapPort();
|
||||
$useSsl = OcHelper::useSsl();
|
||||
$this->ldapAdminUser = OcHelper::getBindDN();
|
||||
$this->ldapAdminPassword = OcHelper::getBindPassword();
|
||||
$this->skipImportLdif = (\getenv("REVA_LDAP_SKIP_LDIF_IMPORT") === "true");
|
||||
if ($useSsl === true) {
|
||||
\putenv('LDAPTLS_REQCERT=never');
|
||||
@@ -385,7 +384,7 @@ trait Provisioning {
|
||||
} elseif ($setDefaultAttributes) {
|
||||
$userAttribute['email'] = $this->getEmailAddressForUser($row['username']);
|
||||
if ($userAttribute['email'] === null) {
|
||||
$userAttribute['email'] = $row['username'] . '@owncloud.com';
|
||||
$userAttribute['email'] = $row['username'] . '@opencloud.eu';
|
||||
}
|
||||
} else {
|
||||
$userAttribute['email'] = null;
|
||||
@@ -439,13 +438,13 @@ trait Provisioning {
|
||||
}
|
||||
if (isset($setting["email"])) {
|
||||
$entry['mail'] = $setting["email"];
|
||||
} elseif (!OcisHelper::isTestingOnReva()) {
|
||||
$entry['mail'] = $userId . '@owncloud.com';
|
||||
} elseif (!OcHelper::isTestingOnReva()) {
|
||||
$entry['mail'] = $userId . '@opencloud.eu';
|
||||
}
|
||||
$entry['gidNumber'] = 5000;
|
||||
$entry['uidNumber'] = $uidNumber;
|
||||
|
||||
if (!OcisHelper::isTestingOnReva()) {
|
||||
if (!OcHelper::isTestingOnReva()) {
|
||||
$entry['objectclass'][] = 'ownCloud';
|
||||
$entry['ownCloudUUID'] = WebDavHelper::generateUUIDv4();
|
||||
}
|
||||
@@ -461,7 +460,7 @@ trait Provisioning {
|
||||
LDAP_ESCAPE_DN
|
||||
) . ",ou=" . $this->ldapUsersOU . "," . $this->ldapBaseDN,
|
||||
);
|
||||
OcisHelper::deleteRevaUserData([$entry['uid']]);
|
||||
OcHelper::deleteRevaUserData([$entry['uid']]);
|
||||
$this->ldap->add($newDN, $entry);
|
||||
}
|
||||
}
|
||||
@@ -490,7 +489,7 @@ trait Provisioning {
|
||||
$entry['objectclass'][] = 'groupOfNames';
|
||||
$entry['member'] = "";
|
||||
}
|
||||
if (!OcisHelper::isTestingOnReva()) {
|
||||
if (!OcHelper::isTestingOnReva()) {
|
||||
$entry['objectclass'][] = 'ownCloud';
|
||||
$entry['ownCloudUUID'] = WebDavHelper::generateUUIDv4();
|
||||
}
|
||||
@@ -585,7 +584,7 @@ trait Provisioning {
|
||||
$userAttributes,
|
||||
__METHOD__ . " userAttributes array does not have key 'userid'"
|
||||
);
|
||||
$attributesToCreateUser['email'] = $userAttributes['userid'] . '@owncloud.com';
|
||||
$attributesToCreateUser['email'] = $userAttributes['userid'] . '@opencloud.eu';
|
||||
} else {
|
||||
$attributesToCreateUser['email'] = $userAttributes['email'];
|
||||
}
|
||||
@@ -958,7 +957,7 @@ trait Provisioning {
|
||||
public function initializeUser(string $user, string $password): void {
|
||||
$url = $this->getBaseUrl() . "/graph/v1.0/users/$user";
|
||||
|
||||
if (OcisHelper::isTestingOnReva()) {
|
||||
if (OcHelper::isTestingOnReva()) {
|
||||
$url = $this->getBaseUrl()
|
||||
. "/ocs/v$this->ocsApiVersion.php/cloud/users/$user";
|
||||
}
|
||||
@@ -1123,7 +1122,7 @@ trait Provisioning {
|
||||
|
||||
if ($email === null) {
|
||||
// escape @ & space if present in userId
|
||||
$email = \str_replace(["@", " "], "", $user) . '@owncloud.com';
|
||||
$email = \str_replace(["@", " "], "", $user) . '@opencloud.eu';
|
||||
}
|
||||
}
|
||||
$user = $this->getActualUsername($user);
|
||||
@@ -1183,7 +1182,7 @@ trait Provisioning {
|
||||
*/
|
||||
public function adminRemovesUserFromGroupUsingTheProvisioningApi(string $user, string $group): void {
|
||||
$user = $this->getActualUsername($user);
|
||||
if (OcisHelper::isTestingOnReva()) {
|
||||
if (OcHelper::isTestingOnReva()) {
|
||||
$this->response = UserHelper::removeUserFromGroup(
|
||||
$this->getBaseUrl(),
|
||||
$user,
|
||||
@@ -1274,12 +1273,12 @@ trait Provisioning {
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function userExists(string $user): bool {
|
||||
$path = (!OcisHelper::isTestingOnReva())
|
||||
$path = (!OcHelper::isTestingOnReva())
|
||||
? "/graph/v1.0"
|
||||
: "/ocs/v2.php/cloud";
|
||||
$fullUrl = $this->getBaseUrl() . $path . "/users/$user";
|
||||
|
||||
if (OcisHelper::isTestingOnReva()) {
|
||||
if (OcHelper::isTestingOnReva()) {
|
||||
$requestingUser = $this->getActualUsername($user);
|
||||
$requestingPassword = $this->getPasswordForUser($user);
|
||||
} else {
|
||||
@@ -1310,7 +1309,7 @@ trait Provisioning {
|
||||
*/
|
||||
public function userShouldBelongToGroup(string $user, string $group): void {
|
||||
$user = $this->getActualUsername($user);
|
||||
if (OcisHelper::isTestingOnReva()) {
|
||||
if (OcHelper::isTestingOnReva()) {
|
||||
$this->userGetsAllTheGroupsOfUser($this->getAdminUsername(), $user);
|
||||
$respondedArray = $this->getArrayOfGroupsResponded($this->response);
|
||||
\sort($respondedArray);
|
||||
@@ -1351,7 +1350,7 @@ trait Provisioning {
|
||||
foreach ($rows as $row) {
|
||||
$user = $this->getActualUsername($row["username"]);
|
||||
$group = $row["groupname"];
|
||||
if (OcisHelper::isTestingOnReva()) {
|
||||
if (OcHelper::isTestingOnReva()) {
|
||||
$fullUrl = $this->getBaseUrl() . "/ocs/v2.php/cloud/users/$user/groups";
|
||||
$response = HttpRequestHelper::get(
|
||||
$fullUrl,
|
||||
@@ -1748,7 +1747,7 @@ trait Provisioning {
|
||||
*/
|
||||
public function adminHasDisabledUserUsingTheProvisioningApi(?string $user): void {
|
||||
$user = $this->getActualUsername($user);
|
||||
if (OcisHelper::isTestingOnReva()) {
|
||||
if (OcHelper::isTestingOnReva()) {
|
||||
$response = $this->disableOrEnableUser($this->getAdminUsername(), $user, 'disable');
|
||||
} else {
|
||||
$response = $this->graphContext->editUserUsingTheGraphApi(
|
||||
@@ -1778,7 +1777,7 @@ trait Provisioning {
|
||||
*/
|
||||
public function deleteUser(string $user): ResponseInterface {
|
||||
// Always try to delete the user
|
||||
if (OcisHelper::isTestingOnReva()) {
|
||||
if (OcHelper::isTestingOnReva()) {
|
||||
$response = UserHelper::deleteUser(
|
||||
$this->getBaseUrl(),
|
||||
$user,
|
||||
@@ -1868,7 +1867,7 @@ trait Provisioning {
|
||||
$this->TheHTTPStatusCodeShouldBe(204, '', $response);
|
||||
}
|
||||
|
||||
if (OcisHelper::isTestingOnReva()) {
|
||||
if (OcHelper::isTestingOnReva()) {
|
||||
$fullUrl = $this->getBaseUrl() . "/ocs/v2.php/cloud/users/$user/groups";
|
||||
$response = HttpRequestHelper::get(
|
||||
$fullUrl,
|
||||
@@ -1979,8 +1978,8 @@ trait Provisioning {
|
||||
* @throws Exception
|
||||
*/
|
||||
public function afterScenario(): void {
|
||||
if (OcisHelper::isTestingOnReva()) {
|
||||
OcisHelper::deleteRevaUserData($this->getCreatedUsers());
|
||||
if (OcHelper::isTestingOnReva()) {
|
||||
OcHelper::deleteRevaUserData($this->getCreatedUsers());
|
||||
}
|
||||
|
||||
if ($this->isTestingWithLdap()) {
|
||||
|
||||
@@ -358,11 +358,7 @@ class PublicWebDavContext implements Context {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $baseUrl URL of owncloud
|
||||
* e.g. http://localhost:8080
|
||||
* should include the subfolder
|
||||
* if owncloud runs in a subfolder
|
||||
* e.g. http://localhost:8080/owncloud-core
|
||||
* @param string $baseUrl URL of OpenCloud
|
||||
* @param string $source
|
||||
* @param string $destination
|
||||
*
|
||||
|
||||
@@ -147,7 +147,7 @@ class SearchContext implements Context {
|
||||
?string $limit = null,
|
||||
?TableNode $properties = null
|
||||
): void {
|
||||
// NOTE: because indexing of newly uploaded files or directories with ocis is decoupled and occurs asynchronously
|
||||
// NOTE: because indexing of newly uploaded files or directories with OpenCloud is decoupled and occurs asynchronously
|
||||
// short wait is necessary before searching
|
||||
sleep(5);
|
||||
$response = $this->searchFiles($user, $pattern, $limit, null, null, null, $properties);
|
||||
@@ -270,7 +270,7 @@ class SearchContext implements Context {
|
||||
string $scope,
|
||||
?string $spaceName = null,
|
||||
): void {
|
||||
// NOTE: since indexing of newly uploaded files or directories with ocis is decoupled and occurs asynchronously,
|
||||
// NOTE: since indexing of newly uploaded files or directories with OpenCloud is decoupled and occurs asynchronously,
|
||||
// a short wait is necessary before searching
|
||||
sleep(5);
|
||||
$response = $this-> searchFiles($user, $pattern, null, $scopeType, $scope, $spaceName);
|
||||
|
||||
@@ -57,8 +57,8 @@ trait Sharing {
|
||||
|
||||
/**
|
||||
* Defines the fields that are known and can be tested in a share response.
|
||||
* Note that ownCloud10 also provides file_parent in responses.
|
||||
* file_parent is not provided by OCIS/reva.
|
||||
* Note that OpenCloud also provides file_parent in responses.
|
||||
* file_parent is not provided by opencloud/reva.
|
||||
* There are no known clients that use file_parent.
|
||||
* The acceptance tests do not test for file_parent.
|
||||
*
|
||||
|
||||
@@ -26,7 +26,7 @@ use GuzzleHttp\Exception\GuzzleException;
|
||||
use PHPUnit\Framework\Assert;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use TestHelpers\GraphHelper;
|
||||
use TestHelpers\OcisHelper;
|
||||
use TestHelpers\OcHelper;
|
||||
use TestHelpers\WebDavHelper;
|
||||
use TestHelpers\HttpRequestHelper;
|
||||
use TestHelpers\BehatHelper;
|
||||
|
||||
@@ -33,13 +33,13 @@ use TestHelpers\HttpRequestHelper;
|
||||
use TestHelpers\WebDavHelper;
|
||||
use TestHelpers\SetupHelper;
|
||||
use TestHelpers\GraphHelper;
|
||||
use TestHelpers\OcisHelper;
|
||||
use TestHelpers\OcHelper;
|
||||
use TestHelpers\BehatHelper;
|
||||
|
||||
require_once 'bootstrap.php';
|
||||
|
||||
/**
|
||||
* Context for ocis spaces specific steps
|
||||
* Context for OpenCloud spaces specific steps
|
||||
*/
|
||||
class SpacesContext implements Context {
|
||||
private FeatureContext $featureContext;
|
||||
@@ -453,7 +453,7 @@ class SpacesContext implements Context {
|
||||
* @throws Exception|GuzzleException
|
||||
*/
|
||||
public function cleanDataAfterTests(): void {
|
||||
if (OcisHelper::isTestingOnReva()) {
|
||||
if (OcHelper::isTestingOnReva()) {
|
||||
return;
|
||||
}
|
||||
$this->deleteAllProjectSpaces();
|
||||
@@ -1978,7 +1978,7 @@ class SpacesContext implements Context {
|
||||
string $fromSpaceName,
|
||||
string $fileDestination,
|
||||
string $toSpaceName,
|
||||
TableNode $table = null
|
||||
?TableNode $table = null
|
||||
): void {
|
||||
$space = $this->getSpaceByName($user, $fromSpaceName);
|
||||
$headers['Destination'] = $this->destinationHeaderValueWithSpaceName(
|
||||
@@ -2146,7 +2146,7 @@ class SpacesContext implements Context {
|
||||
string $user,
|
||||
string $fileDestination,
|
||||
string $spaceName,
|
||||
string $endPath = null
|
||||
?string $endPath = null
|
||||
): string {
|
||||
$space = $this->getSpaceByName($user, $spaceName);
|
||||
$fileDestination = $this->escapePath(\ltrim($fileDestination, "/"));
|
||||
@@ -3229,8 +3229,7 @@ class SpacesContext implements Context {
|
||||
/**
|
||||
* User gets all objects in the trash of project space
|
||||
*
|
||||
* Method "getTrashbinContentFromResponseXml" borrowed from core repository
|
||||
* and return array like:
|
||||
* Method "getTrashbinContentFromResponseXml" returns array like:
|
||||
* [1] => Array
|
||||
* (
|
||||
* [href] => /dav/spaces/trash-bin/spaceId/objectId/
|
||||
@@ -4070,7 +4069,6 @@ class SpacesContext implements Context {
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function searchResultShouldContainSpace(string $user, string $spaceName): void {
|
||||
// get a response after a Report request (called in the core)
|
||||
$responseArray = json_decode(
|
||||
json_encode(
|
||||
HttpRequestHelper::getResponseXml($this->featureContext->getResponse())->xpath("//d:response/d:href")
|
||||
@@ -4621,7 +4619,7 @@ class SpacesContext implements Context {
|
||||
string $recipientType,
|
||||
string $recipient,
|
||||
string $role,
|
||||
string $expirationDate = null
|
||||
?string $expirationDate = null
|
||||
): void {
|
||||
$response = $this->listAllAvailableSpacesOfUser($user);
|
||||
$this->featureContext->theHTTPStatusCodeShouldBe(
|
||||
|
||||
@@ -261,7 +261,7 @@ class TUSContext implements Context {
|
||||
string $destination,
|
||||
array $uploadMetadata = [],
|
||||
int $noOfChunks = 1,
|
||||
int $bytes = null,
|
||||
?int $bytes = null,
|
||||
string $checksum = ''
|
||||
): void {
|
||||
$this->uploadFileUsingTus($user, $source, $destination, null, $uploadMetadata, $noOfChunks, $bytes, $checksum);
|
||||
@@ -287,7 +287,7 @@ class TUSContext implements Context {
|
||||
?string $spaceId = null,
|
||||
array $uploadMetadata = [],
|
||||
int $noOfChunks = 1,
|
||||
int $bytes = null,
|
||||
?int $bytes = null,
|
||||
string $checksum = ''
|
||||
) {
|
||||
$user = $this->featureContext->getActualUsername($user);
|
||||
|
||||
@@ -26,7 +26,7 @@ use GuzzleHttp\Exception\GuzzleException;
|
||||
use PHPUnit\Framework\Assert;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use GuzzleHttp\Stream\StreamInterface;
|
||||
use TestHelpers\OcisHelper;
|
||||
use TestHelpers\OcHelper;
|
||||
use TestHelpers\UploadHelper;
|
||||
use TestHelpers\WebDavHelper;
|
||||
use TestHelpers\HttpRequestHelper;
|
||||
@@ -203,8 +203,8 @@ trait WebDav {
|
||||
|
||||
/**
|
||||
* gives the DAV path of a file including the subfolder of the webserver
|
||||
* e.g. when the server runs in `http://localhost/owncloud/`
|
||||
* this function will return `owncloud/webdav/prueba.txt`
|
||||
* e.g. when the server runs in `http://localhost/opencloud/`
|
||||
* this function will return `opencloud/webdav/prueba.txt`
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $spaceId
|
||||
@@ -1809,22 +1809,22 @@ trait WebDav {
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then the HTTP status code of responses on each endpoint should be :ocisStatusCodes on oCIS or :revaStatusCodes on reva
|
||||
* @Then the HTTP status code of responses on each endpoint should be :ocStatusCodes on OpenCloud or :revaStatusCodes on reva
|
||||
*
|
||||
* @param string $ocisStatusCodes a comma-separated string of expected HTTP status codes when running on oCIS
|
||||
* @param string $ocStatusCodes a comma-separated string of expected HTTP status codes when running on OpenCloud
|
||||
* @param string $revaStatusCodes a comma-separated string of expected HTTP status codes when running on reva
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function theHTTPStatusCodeOfResponsesOnEachEndpointShouldBeOcisReva(
|
||||
string $ocisStatusCodes,
|
||||
public function theHTTPStatusCodeOfResponsesOnEachEndpointShouldBeOcReva(
|
||||
string $ocStatusCodes,
|
||||
string $revaStatusCodes
|
||||
): void {
|
||||
if (OcisHelper::isTestingOnReva()) {
|
||||
if (OcHelper::isTestingOnReva()) {
|
||||
$expectedStatusCodes = $revaStatusCodes;
|
||||
} else {
|
||||
$expectedStatusCodes = $ocisStatusCodes;
|
||||
$expectedStatusCodes = $ocStatusCodes;
|
||||
}
|
||||
$this->checkTheHTTPStatusCodeOfResponsesOnEachEndpoint($expectedStatusCodes);
|
||||
}
|
||||
@@ -3300,7 +3300,7 @@ trait WebDav {
|
||||
*/
|
||||
public function encodePath(string $path): string {
|
||||
// slashes need to stay
|
||||
// in ocis even brackets are encoded
|
||||
// in OpenCloud even brackets are encoded
|
||||
return \str_replace('%2F', '/', \rawurlencode($path));
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ use PHPUnit\Framework\Assert;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use TestHelpers\HttpRequestHelper;
|
||||
use TestHelpers\WebDavHelper;
|
||||
use TestHelpers\OcisHelper;
|
||||
use TestHelpers\OcHelper;
|
||||
use TestHelpers\BehatHelper;
|
||||
|
||||
require_once 'bootstrap.php';
|
||||
|
||||
@@ -29,11 +29,6 @@ $classLoader->addPsr4("TestHelpers\\", __DIR__ . "/../TestHelpers", true);
|
||||
|
||||
$classLoader->register();
|
||||
|
||||
// while running for the local API tests, the tests code from ownCloud/core is not used
|
||||
// so we need the constants to be defined for the tests to use them, but for the case where,
|
||||
// the tests are running for oC/core API tests, the constants are already defined in the bootstrap.php there
|
||||
// so we do not declare them again to avoid the "already defined" error
|
||||
|
||||
// Sleep for 10 milliseconds
|
||||
if (!\defined('STANDARD_SLEEP_TIME_MILLISEC')) {
|
||||
\define('STANDARD_SLEEP_TIME_MILLISEC', 10);
|
||||
|
||||
Reference in New Issue
Block a user