diff --git a/tests/lib/Sharing/AbstractSharingManagerTests.php b/tests/lib/Sharing/AbstractSharingManagerTests.php index 62260bbf2ae2f..0391dbd93ea52 100644 --- a/tests/lib/Sharing/AbstractSharingManagerTests.php +++ b/tests/lib/Sharing/AbstractSharingManagerTests.php @@ -3019,6 +3019,8 @@ public function testGetShareWithPublicSecret(bool $isSecretPublic): void { unset($share['last_updated']); $this->assertIsList($share['recipients']); $this->assertCount(2, $share['recipients']); + // Sort because database order is not guaranteed + usort($share['recipients'], fn (array $a, array $b): int => $a['value'] <=> $b['value']); $this->assertEquals([ 'class' => TestShareRecipientType1::class, 'value' => 'recipient1', @@ -3159,6 +3161,9 @@ public function testGetShareUniqueDisplayNames(): void { $this->dbConnection->commit(); $share = $this->getShare($accessContext, $id); + + // Sort because database order is not guaranteed + usort($share['sources'], fn (array $a, array $b): int => $a['value'] <=> $b['value']); usort($share['recipients'], fn (array $a, array $b): int => $a['value'] <=> $b['value']); $this->assertEquals([ [