Skip to content

Commit

Permalink
Merge pull request #35104 from owncloud/bp-35101
Browse files Browse the repository at this point in the history
[10.2.0] add new capability privateLinksDetailsParam
  • Loading branch information
Vincent Petry authored Apr 26, 2019
2 parents 73beb5d + 37abcee commit 40ea331
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/files/lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public function getCapabilities() {
],
'files' => [
'privateLinks' => true,
'privateLinksDetailsParam' => true,
'bigfilechunking' => true,
'blacklisted_files' => $this->config->getSystemValue('blacklisted_files', ['.htaccess']),
],
Expand Down
51 changes: 51 additions & 0 deletions apps/files/tests/CapabilitiesTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

namespace OCA\Files;

use OCP\IConfig;
use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;

/**
* @author Semih Serhat Karakaya <karakayasemi@itu.edu.tr>
*
* @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 <http://www.gnu.org/licenses/>
*
*/

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']);
}
}

0 comments on commit 40ea331

Please sign in to comment.