diff options
author | Nina Pypchenko <22447785+nina-py@users.noreply.github.com> | 2021-01-10 19:14:49 +1100 |
---|---|---|
committer | npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com> | 2021-01-14 17:36:17 +0000 |
commit | c14638877c0bb0533a72842ccc7c73d88f5122f0 (patch) | |
tree | bac7b25321ce61e30b578f51a9692ff52955edc8 /apps/files/tests/Controller | |
parent | 97743df3fcd6243f9b2755a4c86586b61a96e793 (diff) | |
download | nextcloud-server-c14638877c0bb0533a72842ccc7c73d88f5122f0.tar.gz nextcloud-server-c14638877c0bb0533a72842ccc7c73d88f5122f0.zip |
Add "Crop image previews" setting to files
Added a new user setting that toggles cropping on image previews
in grid view.
True (default value): crops each image to a square. False: keep original
aspect ratio.
Signed-off-by: Nina Pypchenko <22447785+nina-py@users.noreply.github.com>
Closes #18439.
Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
Diffstat (limited to 'apps/files/tests/Controller')
-rw-r--r-- | apps/files/tests/Controller/ApiControllerTest.php | 13 | ||||
-rw-r--r-- | apps/files/tests/Controller/ViewControllerTest.php | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/apps/files/tests/Controller/ApiControllerTest.php b/apps/files/tests/Controller/ApiControllerTest.php index afef351aea7..1fb6490f143 100644 --- a/apps/files/tests/Controller/ApiControllerTest.php +++ b/apps/files/tests/Controller/ApiControllerTest.php @@ -246,4 +246,17 @@ class ApiControllerTest extends TestCase { $this->assertEquals($expected, $actual); } + + public function testCropImagePreviews() { + $crop = true; + + $this->config->expects($this->once()) + ->method('setUserValue') + ->with($this->user->getUID(), 'files', 'crop_image_previews', $crop); + + $expected = new Http\Response(); + $actual = $this->apiController->cropImagePreviews($crop); + + $this->assertEquals($expected, $actual); + } } diff --git a/apps/files/tests/Controller/ViewControllerTest.php b/apps/files/tests/Controller/ViewControllerTest.php index 2b40697642c..fc2b82de9c8 100644 --- a/apps/files/tests/Controller/ViewControllerTest.php +++ b/apps/files/tests/Controller/ViewControllerTest.php @@ -135,6 +135,7 @@ class ViewControllerTest extends TestCase { [$this->user->getUID(), 'files', 'file_sorting', 'name', 'name'], [$this->user->getUID(), 'files', 'file_sorting_direction', 'asc', 'asc'], [$this->user->getUID(), 'files', 'show_hidden', false, false], + [$this->user->getUID(), 'files', 'crop_image_previews', true, true], [$this->user->getUID(), 'files', 'show_grid', true], ]); @@ -316,6 +317,7 @@ class ViewControllerTest extends TestCase { 'defaultFileSorting' => 'name', 'defaultFileSortingDirection' => 'asc', 'showHiddenFiles' => 0, + 'cropImagePreviews' => 1, 'fileNotFound' => 0, 'allowShareWithLink' => 'yes', 'appNavigation' => $nav, |