Skip to content

Commit

Permalink
TASK: Stabilize criterion hashes in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bwaidelich committed May 16, 2024
1 parent f3737f0 commit 185f9d0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/Integration/EventStoreTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,15 @@ private static function eventEnvelopeToArray(array $keys, EventEnvelope $eventEn
if ($unsupportedKeys !== []) {
throw new InvalidArgumentException(sprintf('Invalid key(s) "%s" for expected event. Allowed keys are: "%s"', implode('", "', $unsupportedKeys), implode('", "', $supportedKeys)), 1684668588);
}
$criterionHashes = $eventEnvelope->criterionHashes->toStringArray();
sort($criterionHashes);
$actualAsArray = [
'id' => $eventEnvelope->event->id->value,
'type' => $eventEnvelope->event->type->value,
'data' => $eventEnvelope->event->data->value,
'tags' => $eventEnvelope->event->tags->toSimpleArray(),
'sequenceNumber' => $eventEnvelope->sequenceNumber->value,
'criteria' => $eventEnvelope->criterionHashes->toStringArray(),
'criteria' => $criterionHashes,
];
foreach (array_diff($supportedKeys, $keys) as $unusedKey) {
unset($actualAsArray[$unusedKey]);
Expand Down

0 comments on commit 185f9d0

Please sign in to comment.