test: fix PROPFIND shares space tests

This commit is contained in:
Saw-jan
2024-10-01 12:58:30 +05:45
parent 7da40861c0
commit 08922584bc
11 changed files with 229 additions and 260 deletions

View File

@@ -116,6 +116,7 @@ class GraphHelper {
public static function getEtagRegex(): string {
return "^\\\"[a-f0-9:.]{1,32}\\\"$";
}
/**
* Federated users have a base64 encoded string of {remoteid}@{provider} as their id
* This regex matches only non empty base64 encoded strings
@@ -126,6 +127,19 @@ class GraphHelper {
return '^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$';
}
/**
* @param string $pattern
*
* @return string regex pattern
*/
public static function sanitizeRegexPattern(string $pattern): string {
$pattern = \str_replace("\\\\", "\\", $pattern);
$pattern = \str_replace("/", "\/", $pattern);
$pattern = \preg_replace('/^\^/', '', $pattern);
$pattern = \preg_replace('/\$$/', '', $pattern);
return "/^$pattern$/";
}
/**
* Key name can consist of @@@
* This function separate such key and return its actual value from actual drive response which can be used for assertion