From 37abcee4eea4b5576883f8bbadafd32acd0f3d0f Mon Sep 17 00:00:00 2001 From: karakayasemi Date: Fri, 26 Apr 2019 14:44:42 +0300 Subject: [PATCH] add new capability privateLinksDetailsParam --- apps/files/lib/Capabilities.php | 1 + apps/files/tests/CapabilitiesTest.php | 51 +++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 apps/files/tests/CapabilitiesTest.php diff --git a/apps/files/lib/Capabilities.php b/apps/files/lib/Capabilities.php index 4d332ecba303..797756bd24ad 100644 --- a/apps/files/lib/Capabilities.php +++ b/apps/files/lib/Capabilities.php @@ -58,6 +58,7 @@ public function getCapabilities() { ], 'files' => [ 'privateLinks' => true, + 'privateLinksDetailsParam' => true, 'bigfilechunking' => true, 'blacklisted_files' => $this->config->getSystemValue('blacklisted_files', ['.htaccess']), ], diff --git a/apps/files/tests/CapabilitiesTest.php b/apps/files/tests/CapabilitiesTest.php new file mode 100644 index 000000000000..54b13e4e3f0a --- /dev/null +++ b/apps/files/tests/CapabilitiesTest.php @@ -0,0 +1,51 @@ + + * + * @copyright Copyright (c) 2019, ownCloud GmbH + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see + * + */ + +class CapabilitiesTest extends TestCase { + + /** @var IConfig| MockObject */ + protected $config; + + /** @var Capabilities */ + protected $capabilities; + + protected function setUp() { + parent::setUp(); + + $this->config = $this->createMock(IConfig::class); + $this->capabilities = new Capabilities($this->config); + } + + public function testGetCapabilities() { + $result = $this->capabilities->getCapabilities(); + $this->assertArrayHasKey('checksums', $result); + $this->assertArrayHasKey('files', $result); + $this->assertArrayHasKey('privateLinksDetailsParam', $result['files']); + $this->assertTrue($result['files']['privateLinksDetailsParam']); + } +}