Completed
Push — stable8.2 ( 5200ba...61a71c )
by
unknown
11:10
created

PartFileInRootUpload   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 15 2
A tearDown() 0 4 1
1
<?php
2
/**
3
 * @author Robin Appelman <[email protected]>
4
 * @author Thomas Müller <[email protected]>
5
 *
6
 * @copyright Copyright (c) 2016, ownCloud, Inc.
7
 * @license AGPL-3.0
8
 *
9
 * This code is free software: you can redistribute it and/or modify
10
 * it under the terms of the GNU Affero General Public License, version 3,
11
 * as published by the Free Software Foundation.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
 * GNU Affero General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Affero General Public License, version 3,
19
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
20
 *
21
 */
22
23
namespace OCA\DAV\Tests\Unit\Connector\Sabre\RequestTest;
24
25
use OC\Files\View;
26
use Test\Traits\EncryptionTrait;
27
28
/**
29
 * Class EncryptionUploadTest
30
 *
31
 * @group DB
32
 *
33
 * @package OCA\DAV\Tests\Unit\Connector\Sabre\RequestTest
34
 */
35
class PartFileInRootUpload extends UploadTest {
36
	protected function setUp() {
37
		$config = \OC::$server->getConfig();
38
		$mockConfig = $this->getMock('\OCP\IConfig');
39
		$mockConfig->expects($this->any())
40
			->method('getSystemValue')
41
			->will($this->returnCallback(function ($key, $default) use ($config) {
42
				if ($key === 'part_file_in_storage') {
43
					return false;
44
				} else {
45
					return $config->getSystemValue($key, $default);
46
				}
47
			}));
48
		$this->overwriteService('AllConfig', $mockConfig);
49
		parent::setUp();
50
	}
51
52
	protected function tearDown() {
53
		$this->restoreService('AllConfig');
54
		return parent::tearDown();
55
	}
56
}
57