nextcloud/apps/dav/tests/unit/Connector/Sabre/RequestTest/PartFileInRootUploadTest.php
Carl Schwan 11cf69d8ba
fix(psalm): Fix static analysis issues in apps/*/tests
There are still 1200 more to fix before we can enable static analysis
for the tests.

Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-01-16 12:00:51 +01:00

42 lines
1.1 KiB
PHP

<?php
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OCA\DAV\Tests\unit\Connector\Sabre\RequestTest;
use OC\AllConfig;
use OCP\IConfig;
use OCP\Server;
/**
* Class PartFileInRootUploadTest
*
*
* @package OCA\DAV\Tests\unit\Connector\Sabre\RequestTest
*/
#[\PHPUnit\Framework\Attributes\Group(name: 'DB')]
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();
}
}