Skip to content

Commit

Permalink
fixup! feat(groups) Add group backend
Browse files Browse the repository at this point in the history
  • Loading branch information
blizzz committed Nov 20, 2023
1 parent 0e8d0b3 commit a633310
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/integration/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public function theUserValueShouldBe(string $key, string $value): void {
if (isset($source[$subKey])) {
$source = $source[$subKey];
if (!is_array($source)) {
$actualValue = $source;
$actualValue = (string)$source;
}
} else {
break;
Expand All @@ -272,12 +272,20 @@ public function theUserValueShouldBe(string $key, string $value): void {

$responseArray['data'][$key] = '';
}

$actualValue = $actualValue ?? $responseArray['data'][$key];
if (is_array($actualValue)) {
$actualValue = implode(', ', $actualValue);
// transform array to string, ensuring values are in the same order
$value = explode(',', $value);
$value = array_map('trim', $value);
sort($value);
$value = implode(',', $value);

sort($actualValue);
$actualValue = implode(',', $actualValue);
}

if ((string)$actualValue !== $value) {
if ($actualValue !== $value) {
throw new UnexpectedValueException(
sprintf(
'Expected %s as value but got %s',
Expand Down

0 comments on commit a633310

Please sign in to comment.