mirror of
https://github.com/nextcloud/server.git
synced 2024-12-29 16:38:28 +00:00
49dd79eabb
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
48 lines
1.1 KiB
PHP
48 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
namespace Test\Lockdown\Filesystem;
|
|
|
|
use OC\Authentication\Token\PublicKeyToken;
|
|
use OC\Files\Filesystem;
|
|
use OC\Lockdown\Filesystem\NullStorage;
|
|
use OCP\Authentication\Token\IToken;
|
|
use Test\Traits\UserTrait;
|
|
|
|
/**
|
|
* @group DB
|
|
*/
|
|
class NoFSTest extends \Test\TestCase {
|
|
use UserTrait;
|
|
|
|
protected function tearDown(): void {
|
|
$token = new PublicKeyToken();
|
|
$token->setScope([
|
|
IToken::SCOPE_FILESYSTEM => true
|
|
]);
|
|
\OC::$server->get('LockdownManager')->setToken($token);
|
|
parent::tearDown();
|
|
}
|
|
|
|
protected function setUp(): void {
|
|
parent::setUp();
|
|
$token = new PublicKeyToken();
|
|
$token->setScope([
|
|
IToken::SCOPE_FILESYSTEM => false
|
|
]);
|
|
|
|
\OC::$server->get('LockdownManager')->setToken($token);
|
|
$this->createUser('foo', 'var');
|
|
}
|
|
|
|
public function testSetupFS(): void {
|
|
\OC_Util::tearDownFS();
|
|
\OC_Util::setupFS('foo');
|
|
|
|
$this->assertInstanceOf(NullStorage::class, Filesystem::getStorage('/foo/files'));
|
|
}
|
|
}
|