Skip to content

Commit

Permalink
Use valid Depth values in tests
Browse files Browse the repository at this point in the history
Added validation to prevent using invalid depths and causing failure
against OCIS servers.
Fixes occurrences of invalid depth values and used infinity instead.
  • Loading branch information
Vincent Petry committed May 22, 2020
1 parent 1d6094c commit 01197a0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions tests/TestHelpers/WebDavHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ public static function propfind(
}
$propertyBody .= "<$namespacePrefix:$property/>";
}
$folderDepth = (string) $folderDepth;
if ($folderDepth !== '0' && $folderDepth !== '1' && $folderDepth !== 'infinity') {
throw new InvalidArgumentException('Invalid depth value ' . $folderDepth);
}
$headers = ['Depth' => $folderDepth];
$body = "<?xml version=\"1.0\"?>
<d:propfind
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/features/bootstrap/TagsContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,7 @@ private function requestTagsForFile($user, $fileName, $sharingUser = null) {
$this->featureContext->getBaseUrl(),
$user,
$this->featureContext->getPasswordForUser($user),
$fullPath, $properties, 'systemtags',
$fullPath, $properties, 0, 'systemtags',
$this->featureContext->getDavPathVersion('systemtags')
);
$this->featureContext->setResponse($response);
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/features/bootstrap/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -1416,7 +1416,7 @@ public function checkElementList(
$user, $elements, $expectedToBeListed = true
) {
$this->verifyTableNodeColumnsCount($elements, 1);
$responseXmlObject = $this->listFolder($user, "/", 5);
$responseXmlObject = $this->listFolder($user, "/", "infinity");
$elementRows = $elements->getRows();
$elementsSimplified = $this->simplifyArray($elementRows);
foreach ($elementsSimplified as $expectedElement) {
Expand Down

0 comments on commit 01197a0

Please sign in to comment.