nextcloud/apps/dav/tests/unit/Connector/Sabre/RequestTest/PartFileInRootUploadTest.php

43 lines
1.1 KiB
PHP
Raw Normal View History

<?php
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/
2016-05-25 10:04:15 -04:00
namespace OCA\DAV\Tests\unit\Connector\Sabre\RequestTest;
use OC\AllConfig;
use OCP\IConfig;
use OCP\Server;
/**
2016-05-25 10:04:15 -04:00
* Class PartFileInRootUploadTest
*
*
2016-05-25 10:04:15 -04:00
* @package OCA\DAV\Tests\unit\Connector\Sabre\RequestTest
*/
#[\PHPUnit\Framework\Attributes\Group(name: 'DB')]
2016-05-25 10:04:15 -04:00
class PartFileInRootUploadTest extends UploadTest {
protected function setUp(): void {
$config = Server::get(IConfig::class);
$mockConfig = $this->createMock(IConfig::class);
$mockConfig->expects($this->any())
->method('getSystemValue')
->willReturnCallback(function ($key, $default) use ($config) {
if ($key === 'part_file_in_storage') {
return false;
} else {
return $config->getSystemValue($key, $default);
}
});
$this->overwriteService(AllConfig::class, $mockConfig);
parent::setUp();
}
protected function tearDown(): void {
$this->restoreService('AllConfig');
parent::tearDown();
}
}