Skip to content

Commit efc798d

Browse files
committed
test: adjust tests to unsorted folder listing
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent 06c625f commit efc798d

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

tests/lib/Files/ViewTest.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ public function testCacheAPI(): void {
215215
$this->assertEquals('httpd/unix-directory', $cachedData['mimetype']);
216216

217217
$folderData = $rootView->getDirectoryContent('/');
218+
usort($folderData, fn (FileInfo $a, FileInfo $b) => $a->getName() <=> $b->getName());
218219
/**
219220
* expected entries:
220221
* folder
@@ -234,6 +235,7 @@ public function testCacheAPI(): void {
234235
$this->assertEquals($storageSize, $folderData[3]['size']);
235236

236237
$folderData = $rootView->getDirectoryContent('/substorage');
238+
usort($folderData, fn (FileInfo $a, FileInfo $b) => $a->getName() <=> $b->getName());
237239
/**
238240
* expected entries:
239241
* folder
@@ -2817,11 +2819,13 @@ public function testMountpointParentsCreated(): void {
28172819
$rootView = new View('');
28182820

28192821
$folderData = $rootView->getDirectoryContent('/');
2822+
usort($folderData, fn (FileInfo $a, FileInfo $b) => $a->getName() <=> $b->getName());
28202823
$this->assertCount(4, $folderData);
2821-
$this->assertEquals('folder', $folderData[0]['name']);
2822-
$this->assertEquals('foo.png', $folderData[1]['name']);
2823-
$this->assertEquals('foo.txt', $folderData[2]['name']);
2824-
$this->assertEquals('A', $folderData[3]['name']);
2824+
2825+
$this->assertEquals('A', $folderData[0]['name']);
2826+
$this->assertEquals('folder', $folderData[1]['name']);
2827+
$this->assertEquals('foo.png', $folderData[2]['name']);
2828+
$this->assertEquals('foo.txt', $folderData[3]['name']);
28252829

28262830
$folderData = $rootView->getDirectoryContent('/A');
28272831
$this->assertCount(1, $folderData);
@@ -2832,6 +2836,7 @@ public function testMountpointParentsCreated(): void {
28322836
$this->assertEquals('C', $folderData[0]['name']);
28332837

28342838
$folderData = $rootView->getDirectoryContent('/A/B/C');
2839+
usort($folderData, fn (FileInfo $a, FileInfo $b) => $a->getName() <=> $b->getName());
28352840
$this->assertCount(3, $folderData);
28362841
$this->assertEquals('folder', $folderData[0]['name']);
28372842
$this->assertEquals('foo.png', $folderData[1]['name']);

0 commit comments

Comments
 (0)