You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
nextcloud-server/tests/lib/Lockdown/Filesystem/NoFSTest.php

47 lines
1.1 KiB

<?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'));
}
}