test: update tests related to issue-1124

test: fix tests and issue tags
This commit is contained in:
Saw-jan
2024-07-29 14:57:52 +05:45
parent e14773628d
commit d8c74a30a2
7 changed files with 338 additions and 99 deletions
+20 -11
View File
@@ -130,7 +130,7 @@ class WebDavHelper {
if (\is_int($namespaceString)) {
//default namespace prefix if the property has no array key
//also used if no prefix is given in the property value
$namespacePrefix = "d";
$namespacePrefix = null;
} else {
//calculate the namespace prefix and namespace from the array key
$matches = [];
@@ -145,7 +145,12 @@ class WebDavHelper {
$namespacePrefix = $propertyParts[0];
$property = $propertyParts[1];
}
$propertyBody .= "<$namespacePrefix:$property/>";
if ($namespacePrefix){
$propertyBody .= "<$namespacePrefix:$property/>";
} else {
$propertyBody .= "<$property/>";
}
}
$body = "<?xml version=\"1.0\"?>
<d:propfind
@@ -253,18 +258,22 @@ class WebDavHelper {
?string $propertyName,
?string $propertyValue,
?string $xRequestId = '',
?string $namespaceString = "oc='http://owncloud.org/ns'",
?string $namespaceString = null,
?int $davPathVersionToUse = self::DAV_VERSION_NEW,
?string $type="files"
):ResponseInterface {
$matches = [];
\preg_match("/^(.*)='(.*)'$/", $namespaceString, $matches);
$namespace = $matches[2];
$namespacePrefix = $matches[1];
$propertyBody = "<$namespacePrefix:$propertyName" .
" xmlns:$namespacePrefix=\"$namespace\">" .
"$propertyValue" .
"</$namespacePrefix:$propertyName>";
if ($namespaceString !== null) {
$matches = [];
\preg_match("/^(.*)='(.*)'$/", $namespaceString, $matches);
$namespace = $matches[2];
$namespacePrefix = $matches[1];
$propertyBody = "<$namespacePrefix:$propertyName" .
" xmlns:$namespacePrefix=\"$namespace\">" .
"$propertyValue" .
"</$namespacePrefix:$propertyName>";
} else {
$propertyBody = "<$propertyName>$propertyValue</$propertyName>";
}
$body = "<?xml version=\"1.0\"?>
<d:propertyupdate xmlns:d=\"DAV:\"
xmlns:oc=\"http://owncloud.org/ns\">