adjust compare oc:tags lists

This commit is contained in:
Phil Davis
2023-06-08 13:14:24 +05:45
parent 0e2055bd46
commit 3c99877129
@@ -3153,6 +3153,15 @@ class SpacesContext implements Context {
case "oc:privatelink":
Assert::assertEquals($this->getPrivateLink($user, $spaceNameOrMountPoint), $responseValue, 'cannot find private link for space or resource in the response');
break;
case "oc:tags":
// The value should be a comma-separated string of tag names.
// We do not care what order they happen to be in, so compare as sorted lists.
$expectedTags = \explode(",", $value);
$expectedTags = \sort($expectedTags);
$actualTags = \explode(",", $responseValue);
$actualTags = \sort($actualTags);
Assert::assertEquals($expectedTags, $actualTags, "wrong $findItem in the response");
break;
default:
Assert::assertEquals($value, $responseValue, "wrong $findItem in the response");
break;