explicitly sort files when using getFolderContents
This commit is contained in:
parent
8ce5e0d30d
commit
ad706229f5
|
@ -87,7 +87,7 @@ class Cache {
|
||||||
if ($fileId > -1) {
|
if ($fileId > -1) {
|
||||||
$query = \OC_DB::prepare(
|
$query = \OC_DB::prepare(
|
||||||
'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `encrypted`
|
'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `encrypted`
|
||||||
FROM `*PREFIX*filecache` WHERE parent = ?');
|
FROM `*PREFIX*filecache` WHERE parent = ? ORDER BY `fileid` ASC');
|
||||||
$result = $query->execute(array($fileId));
|
$result = $query->execute(array($fileId));
|
||||||
return $result->fetchAll();
|
return $result->fetchAll();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -55,20 +55,20 @@ class View extends \PHPUnit_Framework_TestCase {
|
||||||
$folderData = $rootView->getDirectoryContent('/');
|
$folderData = $rootView->getDirectoryContent('/');
|
||||||
/**
|
/**
|
||||||
* expected entries:
|
* expected entries:
|
||||||
* folder
|
|
||||||
* foo.png
|
* foo.png
|
||||||
* foo.txt
|
* foo.txt
|
||||||
|
* folder
|
||||||
* substorage
|
* substorage
|
||||||
*/
|
*/
|
||||||
$this->assertEquals(4, count($folderData));
|
$this->assertEquals(4, count($folderData));
|
||||||
$this->assertEquals('folder', $folderData[0]['name']);
|
$this->assertEquals('foo.png', $folderData[0]['name']);
|
||||||
$this->assertEquals('foo.png', $folderData[1]['name']);
|
$this->assertEquals('foo.txt', $folderData[1]['name']);
|
||||||
$this->assertEquals('foo.txt', $folderData[2]['name']);
|
$this->assertEquals('folder', $folderData[2]['name']);
|
||||||
$this->assertEquals('substorage', $folderData[3]['name']);
|
$this->assertEquals('substorage', $folderData[3]['name']);
|
||||||
|
|
||||||
$this->assertEquals($storageSize + $textSize, $folderData[0]['size']);
|
$this->assertEquals($imageSize, $folderData[0]['size']);
|
||||||
$this->assertEquals($imageSize, $folderData[1]['size']);
|
$this->assertEquals($textSize, $folderData[1]['size']);
|
||||||
$this->assertEquals($textSize, $folderData[2]['size']);
|
$this->assertEquals($storageSize + $textSize, $folderData[2]['size']);
|
||||||
$this->assertEquals($storageSize, $folderData[3]['size']);
|
$this->assertEquals($storageSize, $folderData[3]['size']);
|
||||||
|
|
||||||
$folderView = new \OC\Files\View('/folder');
|
$folderView = new \OC\Files\View('/folder');
|
||||||
|
|
Loading…
Reference in New Issue