diff options
author | Robin Appelman <robin@icewind.nl> | 2016-07-22 13:58:53 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2016-07-22 15:20:55 +0200 |
commit | 81e103074ea6ce9e7035734bc527ab582dbca89f (patch) | |
tree | 3037e8325e1e09d401cdff19c49a66786cba3c0a /tests | |
parent | a4ba3eadd0d1e04dc4ef5d11dae59c7dc98c4466 (diff) | |
download | nextcloud-server-81e103074ea6ce9e7035734bc527ab582dbca89f.tar.gz nextcloud-server-81e103074ea6ce9e7035734bc527ab582dbca89f.zip |
use limit instead of since when listing recent files
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Files/Node/FolderTest.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/lib/Files/Node/FolderTest.php b/tests/lib/Files/Node/FolderTest.php index eef78e7d428..18acfcae1fa 100644 --- a/tests/lib/Files/Node/FolderTest.php +++ b/tests/lib/Files/Node/FolderTest.php @@ -836,7 +836,7 @@ class FolderTest extends \Test\TestCase { 'mimetype' => 'text/plain', 'size' => 3 ]); - $cache->put('bar/foo/toold.txt', [ + $id3 = $cache->put('bar/foo/older.txt', [ 'storage_mtime' => $baseTime - 600, 'mtime' => $baseTime - 600, 'mimetype' => 'text/plain', @@ -846,11 +846,11 @@ class FolderTest extends \Test\TestCase { $node = new \OC\Files\Node\Folder($root, $view, $folderPath, $folderInfo); - $nodes = $node->getRecent($baseTime - 500); + $nodes = $node->getRecent(5); $ids = array_map(function (Node $node) { return (int)$node->getId(); }, $nodes); - $this->assertEquals([$id1, $id2], $ids); + $this->assertEquals([$id1, $id2, $id3], $ids); } public function testRecentFolder() { @@ -900,14 +900,13 @@ class FolderTest extends \Test\TestCase { $node = new \OC\Files\Node\Folder($root, $view, $folderPath, $folderInfo); - $nodes = $node->getRecent($baseTime - 500); + $nodes = $node->getRecent(5); $ids = array_map(function (Node $node) { return (int)$node->getId(); }, $nodes); - $this->assertEquals([$id2, $id1, $id3], $ids);// sort folders before files with the same mtime, folders get the lowest child mtime + $this->assertEquals([$id2, $id3], $ids); $this->assertEquals($baseTime, $nodes[0]->getMTime()); $this->assertEquals($baseTime - 100, $nodes[1]->getMTime()); - $this->assertEquals($baseTime - 100, $nodes[2]->getMTime()); } public function testRecentJail() { @@ -952,7 +951,7 @@ class FolderTest extends \Test\TestCase { $node = new \OC\Files\Node\Folder($root, $view, $folderPath, $folderInfo); - $nodes = $node->getRecent($baseTime - 500); + $nodes = $node->getRecent(5); $ids = array_map(function (Node $node) { return (int)$node->getId(); }, $nodes); |