test: adjust tests to unsorted share listing

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2026-05-07 19:19:23 +02:00 committed by backportbot[bot]
parent 52f62effa8
commit d098916b95

View file

@ -660,6 +660,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$share->method('getId')->willReturn($id);
$children = $this->provider->getChildren($share);
usort($children, fn (IShare $a, IShare $b) => $a->getId() <=> $b->getId());
$this->assertCount(2, $children);
@ -2640,6 +2641,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertSame(IShare::TYPE_USER, $file_shares[0]->getShareType());
$folder_shares = $result[$folder2->getId()];
usort($folder_shares, fn (IShare $a, IShare $b) => $a->getId() <=> $b->getId());
$this->assertCount(2, $folder_shares);
$this->assertSame($folder2->getId(), $folder_shares[0]->getNodeId());
$this->assertSame($folder2->getId(), $folder_shares[1]->getNodeId());
@ -3100,6 +3102,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
->willReturn(1);
$shares = $this->provider->getSharesByPath($node);
usort($shares, fn (IShare $a, IShare $b) => $a->getId() <=> $b->getId());
$this->assertCount(3, $shares);
$this->assertEquals($id1, $shares[0]->getId());