mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-06 04:09:40 -06:00
Review address for separate functon
This commit is contained in:
committed by
Phil Davis
parent
a05a746297
commit
b9fda28235
@@ -54,6 +54,28 @@ class GraphHelper {
|
||||
return (bool)preg_match($regex, $spaceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @param string $keyName
|
||||
* @param array $actualDriveInformation
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function separateAndGetValueForKey(string $keyName, array $actualDriveInformation): string {
|
||||
// break the segment with @@@ to find the actual value from the actual drive infromation
|
||||
$separatedKey = explode("@@@", $keyName);
|
||||
// this stores the actual value of each key from drive information response used for assertion
|
||||
$actualKeyValue = $actualDriveInformation;
|
||||
|
||||
foreach ($separatedKey as $key) {
|
||||
$actualKeyValue = $actualKeyValue[$key];
|
||||
}
|
||||
|
||||
return $actualKeyValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $baseUrl
|
||||
* @param string $path
|
||||
|
||||
Reference in New Issue
Block a user