Skip to content

Commit

Permalink
test: do not try graph endpoints if testing on reva
Browse files Browse the repository at this point in the history
  • Loading branch information
saw-jan committed Dec 4, 2024
1 parent dee504f commit a156998
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions tests/acceptance/TestHelpers/WebDavHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -520,23 +520,26 @@ public static function getPersonalSpaceIdForUser(string $baseUrl, string $user,
if (\array_key_exists($user, self::$spacesIdRef) && \array_key_exists("personal", self::$spacesIdRef[$user])) {
return self::$spacesIdRef[$user]["personal"];
}
$trimmedBaseUrl = \trim($baseUrl, "/");
$drivesPath = '/graph/v1.0/me/drives';
$fullUrl = $trimmedBaseUrl . $drivesPath;
$response = HttpRequestHelper::get(
$fullUrl,
$xRequestId,
$user,
$password
);
Assert::assertEquals(200, $response->getStatusCode(), "Cannot list drives for user '$user'");

$trimmedBaseUrl = \trim($baseUrl, "/");
$personalSpaceId = '';
$drives = HttpRequestHelper::getJsonDecodedResponseBodyContent($response);
foreach ($drives->value as $drive) {
if ($drive->driveType === "personal") {
$personalSpaceId = $drive->id;
break;
if (!OcisHelper::isTestingOnReva()) {
$drivesPath = '/graph/v1.0/me/drives';
$fullUrl = $trimmedBaseUrl . $drivesPath;
$response = HttpRequestHelper::get(
$fullUrl,
$xRequestId,
$user,
$password
);
Assert::assertEquals(200, $response->getStatusCode(), "Cannot list drives for user '$user'");

$drives = HttpRequestHelper::getJsonDecodedResponseBodyContent($response);
foreach ($drives->value as $drive) {
if ($drive->driveType === "personal") {
$personalSpaceId = $drive->id;
break;
}
}
}

Expand Down

0 comments on commit a156998

Please sign in to comment.