Skip to content

Commit 1896f01

Browse files
datapumpernickelChartman123
authored andcommitted
fix: phpunit test with sort()
Signed-off-by: paul bochtler <65470117+datapumpernickel@users.noreply.github.com>
1 parent c398db4 commit 1896f01

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/Service/SubmissionService.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,10 @@ public function validateSubmission(array $questions, array $answers, string $for
586586
$optionIds = array_map('intval', array_column($question['options'] ?? [], 'id'));
587587
$rankedIds = array_map('intval', $answers[$questionId]);
588588

589-
if (sort($rankedIds) !== sort($optionIds)) {
589+
sort($optionIds);
590+
sort($rankedIds);
591+
592+
if ($rankedIds !== $optionIds) {
590593
throw new \InvalidArgumentException(sprintf('Ranking for question "%s" must include all options exactly once.', $question['text']));
591594
}
592595
}

0 commit comments

Comments
 (0)