diff --git a/tests/acceptance/features/bootstrap/WebDav.php b/tests/acceptance/features/bootstrap/WebDav.php index 9d16f7d3425b..3f1d1e8202c7 100644 --- a/tests/acceptance/features/bootstrap/WebDav.php +++ b/tests/acceptance/features/bootstrap/WebDav.php @@ -5054,7 +5054,7 @@ function ($value) { }, $elementRows ); - $resultEntries = $this->findEntryFromPropfindResponse(null, $user); + $resultEntries = $this->findEntryFromPropfindResponse(null, $user, "REPORT"); foreach ($resultEntries as $resultEntry) { Assert::assertContains($resultEntry, $expectedEntries); } @@ -5297,18 +5297,25 @@ public function findEntryFromPropfindResponse( foreach ($multistatusResults as $multistatusResult) { $entryPath = $multistatusResult['value'][0]['value']; if (OcisHelper::isTestingOnOcis() && $method === "REPORT") { - $entryName = \rawurldecode($entryPath); - if (str_ends_with($entryName, $entryNameToSearch)) { - return $multistatusResult; - } - } else { - $entryName = \str_replace($topWebDavPath, "", $entryPath); - $entryName = \rawurldecode($entryName); - $entryName = \trim($entryName, "/"); - if ($trimmedEntryNameToSearch === $entryName) { - return $multistatusResult; + if ($entryNameToSearch !== null && str_ends_with($entryPath, $entryNameToSearch)) { + return $multistatusResults; + } else { + $spaceId = WebDavHelper::getPersonalSpaceIdForUser( + $this->getBaseUrl(), + $user, + $this->getPasswordForUser($user), + $this->getStepLineRef() + ); + $splitSpaceID = explode("$", $spaceId); + $topWebDavPath = "/dav/spaces/" . $splitSpaceID[0] . "%21" . "$splitSpaceID[1]" . "/"; } } + $entryName = \str_replace($topWebDavPath, "", $entryPath); + $entryName = \rawurldecode($entryName); + $entryName = \trim($entryName, "/"); + if ($trimmedEntryNameToSearch === $entryName) { + return $multistatusResult; + } \array_push($results, $entryName); } }