diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2016-04-12 17:10:09 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@owncloud.com> | 2016-04-19 16:08:56 +0200 |
commit | 6c5696d3a84ff71fc5ddb53b490bbc77f5c119f5 (patch) | |
tree | 03aec364e0e7f342ab822b2896c8dde6c40ea480 /apps/files/tests | |
parent | f8c55beaae9dc0e5fefb4aa8f78d3d71ea580d59 (diff) | |
download | nextcloud-server-6c5696d3a84ff71fc5ddb53b490bbc77f5c119f5.tar.gz nextcloud-server-6c5696d3a84ff71fc5ddb53b490bbc77f5c119f5.zip |
filter hidden files on the web interface
add checkbox to toggle show/hide hidden files
persist show hidden setting
fix settings menu layout
test ApiController::showHiddenFiles
don't show hidden files by default
Store config in Backbone model and inject it into FileList
Filter files only temporarily when rending the file list
Fix file rename validation
Diffstat (limited to 'apps/files/tests')
-rw-r--r-- | apps/files/tests/controller/ViewControllerTest.php | 6 | ||||
-rw-r--r-- | apps/files/tests/controller/apicontrollertest.php | 14 |
2 files changed, 18 insertions, 2 deletions
diff --git a/apps/files/tests/controller/ViewControllerTest.php b/apps/files/tests/controller/ViewControllerTest.php index 0446cc8982c..420e635b4b9 100644 --- a/apps/files/tests/controller/ViewControllerTest.php +++ b/apps/files/tests/controller/ViewControllerTest.php @@ -155,11 +155,12 @@ class ViewControllerTest extends TestCase { 'owner' => 'MyName', 'ownerDisplayName' => 'MyDisplayName', ])); - $this->config->expects($this->exactly(2)) + $this->config->expects($this->exactly(3)) ->method('getUserValue') ->will($this->returnValueMap([ [$this->user->getUID(), 'files', 'file_sorting', 'name', 'name'], - [$this->user->getUID(), 'files', 'file_sorting_direction', 'asc', 'asc'] + [$this->user->getUID(), 'files', 'file_sorting_direction', 'asc', 'asc'], + [$this->user->getUID(), 'files', 'show_hidden', false, false], ])); $this->config @@ -244,6 +245,7 @@ class ViewControllerTest extends TestCase { 'isPublic' => false, 'defaultFileSorting' => 'name', 'defaultFileSortingDirection' => 'asc', + 'showHiddenFiles' => false, 'mailNotificationEnabled' => 'no', 'mailPublicNotificationEnabled' => 'no', 'allowShareWithLink' => 'yes', diff --git a/apps/files/tests/controller/apicontrollertest.php b/apps/files/tests/controller/apicontrollertest.php index 59f53e8ee81..2eba7d62feb 100644 --- a/apps/files/tests/controller/apicontrollertest.php +++ b/apps/files/tests/controller/apicontrollertest.php @@ -1,4 +1,5 @@ <?php + /** * @author Christoph Wurst <christoph@winzerhof-wurst.at> * @author Lukas Reschke <lukas@owncloud.com> @@ -382,4 +383,17 @@ class ApiControllerTest extends TestCase { $this->assertEquals($expected, $result); } + public function testShowHiddenFiles() { + $show = false; + + $this->config->expects($this->once()) + ->method('setUserValue') + ->with($this->user->getUID(), 'files', 'show_hidden', $show); + + $expected = new Http\Response(); + $actual = $this->apiController->showHiddenFiles($show); + + $this->assertEquals($expected, $actual); + } + } |