Skip to content

Commit

Permalink
Adjust test for limit search assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
SagarGi committed Jul 19, 2022
1 parent a11e377 commit b2705b5
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 b2705b5

Please sign in to comment.