aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files/tests/Controller/ApiControllerTest.php8
-rw-r--r--apps/files/tests/Controller/ViewControllerTest.php25
-rw-r--r--tests/lib/Files/Node/FolderTest.php5
3 files changed, 30 insertions, 8 deletions
diff --git a/apps/files/tests/Controller/ApiControllerTest.php b/apps/files/tests/Controller/ApiControllerTest.php
index 1d39c88021b..348150e0e08 100644
--- a/apps/files/tests/Controller/ApiControllerTest.php
+++ b/apps/files/tests/Controller/ApiControllerTest.php
@@ -59,6 +59,8 @@ class ApiControllerTest extends TestCase {
private $shareManager;
/** @var \OCP\IConfig */
private $config;
+ /** @var \OC\Files\Node\Folder */
+ private $userFolder;
public function setUp() {
$this->request = $this->getMockBuilder('\OCP\IRequest')
@@ -82,6 +84,9 @@ class ApiControllerTest extends TestCase {
->disableOriginalConstructor()
->getMock();
$this->config = $this->getMock('\OCP\IConfig');
+ $this->userFolder = $this->getMockBuilder('\OC\Files\Node\Folder')
+ ->disableOriginalConstructor()
+ ->getMock();
$this->apiController = new ApiController(
$this->appName,
@@ -90,7 +95,8 @@ class ApiControllerTest extends TestCase {
$this->tagService,
$this->preview,
$this->shareManager,
- $this->config
+ $this->config,
+ $this->userFolder
);
}
diff --git a/apps/files/tests/Controller/ViewControllerTest.php b/apps/files/tests/Controller/ViewControllerTest.php
index ceb48a2241f..25b5b6e04e0 100644
--- a/apps/files/tests/Controller/ViewControllerTest.php
+++ b/apps/files/tests/Controller/ViewControllerTest.php
@@ -191,7 +191,16 @@ class ViewControllerTest extends TestCase {
'appname' => 'files',
'script' => 'list.php',
'order' => 0,
- 'name' => new \OC_L10N_String(new \OC_L10N('files'), 'All files', []),
+ 'name' => (string)new \OC_L10N_String(new \OC_L10N('files'), 'All files', []),
+ 'active' => false,
+ 'icon' => '',
+ ],
+ [
+ 'id' => 'recent',
+ 'appname' => 'files',
+ 'script' => 'list.php',
+ 'order' => 2,
+ 'name' => (string)new \OC_L10N_String(new \OC_L10N('files'), 'Recent', []),
'active' => false,
'icon' => '',
],
@@ -209,7 +218,7 @@ class ViewControllerTest extends TestCase {
'appname' => 'files_sharing',
'script' => 'list.php',
'order' => 10,
- 'name' => new \OC_L10N_String(new \OC_L10N('files_sharing'), 'Shared with you', []),
+ 'name' => (string)new \OC_L10N_String(new \OC_L10N('files_sharing'), 'Shared with you', []),
'active' => false,
'icon' => '',
],
@@ -218,7 +227,7 @@ class ViewControllerTest extends TestCase {
'appname' => 'files_sharing',
'script' => 'list.php',
'order' => 15,
- 'name' => new \OC_L10N_String(new \OC_L10N('files_sharing'), 'Shared with others', []),
+ 'name' => (string)new \OC_L10N_String(new \OC_L10N('files_sharing'), 'Shared with others', []),
'active' => false,
'icon' => '',
],
@@ -227,7 +236,7 @@ class ViewControllerTest extends TestCase {
'appname' => 'files_sharing',
'script' => 'list.php',
'order' => 20,
- 'name' => new \OC_L10N_String(new \OC_L10N('files_sharing'), 'Shared by link', []),
+ 'name' => (string)new \OC_L10N_String(new \OC_L10N('files_sharing'), 'Shared by link', []),
'active' => false,
'icon' => '',
],
@@ -236,7 +245,7 @@ class ViewControllerTest extends TestCase {
'appname' => 'systemtags',
'script' => 'list.php',
'order' => 25,
- 'name' => new \OC_L10N_String(new \OC_L10N('systemtags'), 'Tags', []),
+ 'name' => (string)new \OC_L10N_String(new \OC_L10N('systemtags'), 'Tags', []),
'active' => false,
'icon' => '',
],
@@ -245,7 +254,7 @@ class ViewControllerTest extends TestCase {
'appname' => 'files_trashbin',
'script' => 'list.php',
'order' => 50,
- 'name' => new \OC_L10N_String(new \OC_L10N('files_trashbin'), 'Deleted files', []),
+ 'name' => (string)new \OC_L10N_String(new \OC_L10N('files_trashbin'), 'Deleted files', []),
'active' => false,
'icon' => '',
],
@@ -273,6 +282,10 @@ class ViewControllerTest extends TestCase {
'content' => null,
],
[
+ 'id' => 'recent',
+ 'content' => null,
+ ],
+ [
'id' => 'favorites',
'content' => null,
],
diff --git a/tests/lib/Files/Node/FolderTest.php b/tests/lib/Files/Node/FolderTest.php
index cae6b4a80c0..eef78e7d428 100644
--- a/tests/lib/Files/Node/FolderTest.php
+++ b/tests/lib/Files/Node/FolderTest.php
@@ -890,7 +890,7 @@ class FolderTest extends \Test\TestCase {
'parent' => $id1
]);
$id3 = $cache->put('bar/foo/folder/asd.txt', [
- 'storage_mtime' => $baseTime,
+ 'storage_mtime' => $baseTime - 100,
'mtime' => $baseTime - 100,
'mimetype' => 'text/plain',
'size' => 3,
@@ -905,6 +905,9 @@ class FolderTest extends \Test\TestCase {
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($baseTime, $nodes[0]->getMTime());
+ $this->assertEquals($baseTime - 100, $nodes[1]->getMTime());
+ $this->assertEquals($baseTime - 100, $nodes[2]->getMTime());
}
public function testRecentJail() {