diff --git a/tests/lib/Sharing/AbstractSharingManagerTests.php b/tests/lib/Sharing/AbstractSharingManagerTests.php index 8f4522dc86ff2..ee708d8637cc5 100644 --- a/tests/lib/Sharing/AbstractSharingManagerTests.php +++ b/tests/lib/Sharing/AbstractSharingManagerTests.php @@ -3019,6 +3019,9 @@ public function testGetShareWithPublicSecret(bool $isSecretPublic): void { unset($share['last_updated']); $this->assertIsList($share['recipients']); $this->assertCount(2, $share['recipients']); + // The order in which recipients are returned by the database is not guaranteed, + // so sort them to make assertions on specific indexes reliable. + usort($share['recipients'], fn (array $a, array $b): int => $a['value'] <=> $b['value']); $this->assertEquals([ 'class' => TestShareRecipientType1::class, 'value' => 'recipient1',