123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- namespace Test\Lockdown\Filesystem;
- use OC\Authentication\Token\PublicKeyToken;
- use OC\Files\Filesystem;
- use OC\Lockdown\Filesystem\NullStorage;
- use Test\Traits\UserTrait;
- class NoFSTest extends \Test\TestCase {
- use UserTrait;
- protected function tearDown(): void {
- $token = new PublicKeyToken();
- $token->setScope([
- 'filesystem' => true
- ]);
- \OC::$server->getLockdownManager()->setToken($token);
- parent::tearDown();
- }
- protected function setUp(): void {
- parent::setUp();
- $token = new PublicKeyToken();
- $token->setScope([
- 'filesystem' => false
- ]);
- \OC::$server->getLockdownManager()->setToken($token);
- $this->createUser('foo', 'var');
- }
- public function testSetupFS() {
- \OC_Util::tearDownFS();
- \OC_Util::setupFS('foo');
- $this->assertInstanceOf(NullStorage::class, Filesystem::getStorage('/foo/files'));
- }
- }
|