Skip to content

Commit

Permalink
Merge pull request #40214 from owncloud/adjustCodeForSearchLimitAsser…
Browse files Browse the repository at this point in the history
…tion

[tests-only][full-ci]Adjust test for limit search assertion
  • Loading branch information
phil-davis authored Jul 20, 2022
2 parents 97f8ab8 + 6ece18b commit 854ee4b
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions tests/acceptance/features/bootstrap/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 854ee4b

Please sign in to comment.