Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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']);
}
}