test: fix resource path when using spaces path with Shares space

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>

test: remove unwanted changes

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>

test: check resources by sharer

Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
This commit is contained in:
Saw-jan
2025-05-09 16:22:19 +05:45
parent 6f375eeba8
commit 7aab79deba
5 changed files with 19 additions and 349 deletions

View File

@@ -645,19 +645,23 @@ class WebDavHelper {
}
// get space id if testing with spaces dav
if ($spaceId === null && $davPathVersionToUse === self::DAV_VERSION_SPACES
&& !\in_array($type, ["public-files", "versions"])
) {
if ($davPathVersionToUse === self::DAV_VERSION_SPACES) {
$path = \ltrim($path, "/");
$sharesSpace = false;
if (\str_starts_with($path, "Shares/")) {
$spaceId = GraphHelper::SHARES_SPACE_ID;
$sharesSpace = true;
$path = "/" . preg_replace("/^Shares\//", "", $path);
} else {
$spaceId = self::getPersonalSpaceIdForUserOrFakeIfNotFound(
$baseUrl,
$user,
$password,
);
}
if ($spaceId === null && !\in_array($type, ["public-files", "versions"])) {
if ($sharesSpace) {
$spaceId = GraphHelper::SHARES_SPACE_ID;
} else {
$spaceId = self::getPersonalSpaceIdForUserOrFakeIfNotFound(
$baseUrl,
$user,
$password,
);
}
}
}