@@ -26,168 +26,168 @@ |
||
| 26 | 26 | * @group DB |
| 27 | 27 | */ |
| 28 | 28 | class UserStoragesServiceTest extends StoragesServiceTestCase { |
| 29 | - use UserTrait; |
|
| 30 | - |
|
| 31 | - protected User $user; |
|
| 32 | - |
|
| 33 | - protected string $userId; |
|
| 34 | - protected StoragesService $globalStoragesService; |
|
| 35 | - |
|
| 36 | - protected function setUp(): void { |
|
| 37 | - parent::setUp(); |
|
| 38 | - |
|
| 39 | - $this->globalStoragesService = new GlobalStoragesService($this->backendService, $this->dbConfig, $this->mountCache, $this->eventDispatcher, $this->appConfig); |
|
| 40 | - |
|
| 41 | - $this->userId = $this->getUniqueID('user_'); |
|
| 42 | - $this->createUser($this->userId, $this->userId); |
|
| 43 | - $this->user = Server::get(IUserManager::class)->get($this->userId); |
|
| 44 | - |
|
| 45 | - /** @var IUserSession&MockObject $userSession */ |
|
| 46 | - $userSession = $this->createMock(IUserSession::class); |
|
| 47 | - $userSession |
|
| 48 | - ->expects($this->any()) |
|
| 49 | - ->method('getUser') |
|
| 50 | - ->willReturn($this->user); |
|
| 51 | - |
|
| 52 | - $this->service = new UserStoragesService($this->backendService, $this->dbConfig, $userSession, $this->mountCache, $this->eventDispatcher, $this->appConfig); |
|
| 53 | - } |
|
| 54 | - |
|
| 55 | - private function makeTestStorageData() { |
|
| 56 | - return $this->makeStorageConfig([ |
|
| 57 | - 'mountPoint' => 'mountpoint', |
|
| 58 | - 'backendIdentifier' => 'identifier:\OCA\Files_External\Lib\Backend\SMB', |
|
| 59 | - 'authMechanismIdentifier' => 'identifier:\Auth\Mechanism', |
|
| 60 | - 'backendOptions' => [ |
|
| 61 | - 'option1' => 'value1', |
|
| 62 | - 'option2' => 'value2', |
|
| 63 | - 'password' => 'testPassword', |
|
| 64 | - ], |
|
| 65 | - 'mountOptions' => [ |
|
| 66 | - 'preview' => false, |
|
| 67 | - ] |
|
| 68 | - ]); |
|
| 69 | - } |
|
| 70 | - |
|
| 71 | - public function testAddStorage(): void { |
|
| 72 | - $storage = $this->makeTestStorageData(); |
|
| 73 | - |
|
| 74 | - $newStorage = $this->service->addStorage($storage); |
|
| 75 | - |
|
| 76 | - $id = $newStorage->getId(); |
|
| 77 | - |
|
| 78 | - $newStorage = $this->service->getStorage($id); |
|
| 79 | - |
|
| 80 | - $this->assertEquals($storage->getMountPoint(), $newStorage->getMountPoint()); |
|
| 81 | - $this->assertEquals($storage->getBackend(), $newStorage->getBackend()); |
|
| 82 | - $this->assertEquals($storage->getAuthMechanism(), $newStorage->getAuthMechanism()); |
|
| 83 | - $this->assertEquals($storage->getBackendOptions(), $newStorage->getBackendOptions()); |
|
| 84 | - $this->assertEquals(0, $newStorage->getStatus()); |
|
| 85 | - |
|
| 86 | - // hook called once for user |
|
| 87 | - $this->assertHookCall( |
|
| 88 | - current(self::$hookCalls), |
|
| 89 | - Filesystem::signal_create_mount, |
|
| 90 | - $storage->getMountPoint(), |
|
| 91 | - MountConfig::MOUNT_TYPE_USER, |
|
| 92 | - $this->userId |
|
| 93 | - ); |
|
| 94 | - |
|
| 95 | - $nextStorage = $this->service->addStorage($storage); |
|
| 96 | - $this->assertEquals($id + 1, $nextStorage->getId()); |
|
| 97 | - } |
|
| 98 | - |
|
| 99 | - public function testUpdateStorage(): void { |
|
| 100 | - $storage = $this->makeStorageConfig([ |
|
| 101 | - 'mountPoint' => 'mountpoint', |
|
| 102 | - 'backendIdentifier' => 'identifier:\OCA\Files_External\Lib\Backend\SMB', |
|
| 103 | - 'authMechanismIdentifier' => 'identifier:\Auth\Mechanism', |
|
| 104 | - 'backendOptions' => [ |
|
| 105 | - 'option1' => 'value1', |
|
| 106 | - 'option2' => 'value2', |
|
| 107 | - 'password' => 'testPassword', |
|
| 108 | - ], |
|
| 109 | - ]); |
|
| 110 | - |
|
| 111 | - $newStorage = $this->service->addStorage($storage); |
|
| 112 | - |
|
| 113 | - $backendOptions = $newStorage->getBackendOptions(); |
|
| 114 | - $backendOptions['password'] = 'anotherPassword'; |
|
| 115 | - $newStorage->setBackendOptions($backendOptions); |
|
| 116 | - |
|
| 117 | - self::$hookCalls = []; |
|
| 118 | - |
|
| 119 | - $newStorage = $this->service->updateStorage($newStorage); |
|
| 120 | - |
|
| 121 | - $this->assertEquals('anotherPassword', $newStorage->getBackendOptions()['password']); |
|
| 122 | - $this->assertEquals([$this->userId], $newStorage->getApplicableUsers()); |
|
| 123 | - // these attributes are unused for user storages |
|
| 124 | - $this->assertEmpty($newStorage->getApplicableGroups()); |
|
| 125 | - $this->assertEquals(0, $newStorage->getStatus()); |
|
| 126 | - |
|
| 127 | - // no hook calls |
|
| 128 | - $this->assertEmpty(self::$hookCalls); |
|
| 129 | - } |
|
| 130 | - |
|
| 131 | - #[\PHPUnit\Framework\Attributes\DataProvider('deleteStorageDataProvider')] |
|
| 132 | - public function testDeleteStorage($backendOptions, $rustyStorageId): void { |
|
| 133 | - parent::testDeleteStorage($backendOptions, $rustyStorageId); |
|
| 134 | - |
|
| 135 | - // hook called once for user (first one was during test creation) |
|
| 136 | - $this->assertHookCall( |
|
| 137 | - self::$hookCalls[1], |
|
| 138 | - Filesystem::signal_delete_mount, |
|
| 139 | - '/mountpoint', |
|
| 140 | - MountConfig::MOUNT_TYPE_USER, |
|
| 141 | - $this->userId |
|
| 142 | - ); |
|
| 143 | - } |
|
| 144 | - |
|
| 145 | - public function testHooksRenameMountPoint(): void { |
|
| 146 | - $storage = $this->makeTestStorageData(); |
|
| 147 | - $storage = $this->service->addStorage($storage); |
|
| 148 | - |
|
| 149 | - $storage->setMountPoint('renamedMountpoint'); |
|
| 150 | - |
|
| 151 | - // reset calls |
|
| 152 | - self::$hookCalls = []; |
|
| 153 | - |
|
| 154 | - $this->service->updateStorage($storage); |
|
| 155 | - |
|
| 156 | - // hook called twice |
|
| 157 | - $this->assertHookCall( |
|
| 158 | - self::$hookCalls[0], |
|
| 159 | - Filesystem::signal_delete_mount, |
|
| 160 | - '/mountpoint', |
|
| 161 | - MountConfig::MOUNT_TYPE_USER, |
|
| 162 | - $this->userId |
|
| 163 | - ); |
|
| 164 | - $this->assertHookCall( |
|
| 165 | - self::$hookCalls[1], |
|
| 166 | - Filesystem::signal_create_mount, |
|
| 167 | - '/renamedMountpoint', |
|
| 168 | - MountConfig::MOUNT_TYPE_USER, |
|
| 169 | - $this->userId |
|
| 170 | - ); |
|
| 171 | - } |
|
| 172 | - |
|
| 173 | - |
|
| 174 | - public function testGetAdminStorage(): void { |
|
| 175 | - $this->expectException(NotFoundException::class); |
|
| 176 | - |
|
| 177 | - $backend = $this->backendService->getBackend('identifier:\OCA\Files_External\Lib\Backend\SMB'); |
|
| 178 | - $authMechanism = $this->backendService->getAuthMechanism('identifier:\Auth\Mechanism'); |
|
| 179 | - |
|
| 180 | - $storage = new StorageConfig(); |
|
| 181 | - $storage->setMountPoint('mountpoint'); |
|
| 182 | - $storage->setBackend($backend); |
|
| 183 | - $storage->setAuthMechanism($authMechanism); |
|
| 184 | - $storage->setBackendOptions(['password' => 'testPassword']); |
|
| 185 | - $storage->setApplicableUsers([$this->userId]); |
|
| 186 | - |
|
| 187 | - $newStorage = $this->globalStoragesService->addStorage($storage); |
|
| 188 | - |
|
| 189 | - $this->assertInstanceOf('\OCA\Files_External\Lib\StorageConfig', $this->globalStoragesService->getStorage($newStorage->getId())); |
|
| 190 | - |
|
| 191 | - $this->service->getStorage($newStorage->getId()); |
|
| 192 | - } |
|
| 29 | + use UserTrait; |
|
| 30 | + |
|
| 31 | + protected User $user; |
|
| 32 | + |
|
| 33 | + protected string $userId; |
|
| 34 | + protected StoragesService $globalStoragesService; |
|
| 35 | + |
|
| 36 | + protected function setUp(): void { |
|
| 37 | + parent::setUp(); |
|
| 38 | + |
|
| 39 | + $this->globalStoragesService = new GlobalStoragesService($this->backendService, $this->dbConfig, $this->mountCache, $this->eventDispatcher, $this->appConfig); |
|
| 40 | + |
|
| 41 | + $this->userId = $this->getUniqueID('user_'); |
|
| 42 | + $this->createUser($this->userId, $this->userId); |
|
| 43 | + $this->user = Server::get(IUserManager::class)->get($this->userId); |
|
| 44 | + |
|
| 45 | + /** @var IUserSession&MockObject $userSession */ |
|
| 46 | + $userSession = $this->createMock(IUserSession::class); |
|
| 47 | + $userSession |
|
| 48 | + ->expects($this->any()) |
|
| 49 | + ->method('getUser') |
|
| 50 | + ->willReturn($this->user); |
|
| 51 | + |
|
| 52 | + $this->service = new UserStoragesService($this->backendService, $this->dbConfig, $userSession, $this->mountCache, $this->eventDispatcher, $this->appConfig); |
|
| 53 | + } |
|
| 54 | + |
|
| 55 | + private function makeTestStorageData() { |
|
| 56 | + return $this->makeStorageConfig([ |
|
| 57 | + 'mountPoint' => 'mountpoint', |
|
| 58 | + 'backendIdentifier' => 'identifier:\OCA\Files_External\Lib\Backend\SMB', |
|
| 59 | + 'authMechanismIdentifier' => 'identifier:\Auth\Mechanism', |
|
| 60 | + 'backendOptions' => [ |
|
| 61 | + 'option1' => 'value1', |
|
| 62 | + 'option2' => 'value2', |
|
| 63 | + 'password' => 'testPassword', |
|
| 64 | + ], |
|
| 65 | + 'mountOptions' => [ |
|
| 66 | + 'preview' => false, |
|
| 67 | + ] |
|
| 68 | + ]); |
|
| 69 | + } |
|
| 70 | + |
|
| 71 | + public function testAddStorage(): void { |
|
| 72 | + $storage = $this->makeTestStorageData(); |
|
| 73 | + |
|
| 74 | + $newStorage = $this->service->addStorage($storage); |
|
| 75 | + |
|
| 76 | + $id = $newStorage->getId(); |
|
| 77 | + |
|
| 78 | + $newStorage = $this->service->getStorage($id); |
|
| 79 | + |
|
| 80 | + $this->assertEquals($storage->getMountPoint(), $newStorage->getMountPoint()); |
|
| 81 | + $this->assertEquals($storage->getBackend(), $newStorage->getBackend()); |
|
| 82 | + $this->assertEquals($storage->getAuthMechanism(), $newStorage->getAuthMechanism()); |
|
| 83 | + $this->assertEquals($storage->getBackendOptions(), $newStorage->getBackendOptions()); |
|
| 84 | + $this->assertEquals(0, $newStorage->getStatus()); |
|
| 85 | + |
|
| 86 | + // hook called once for user |
|
| 87 | + $this->assertHookCall( |
|
| 88 | + current(self::$hookCalls), |
|
| 89 | + Filesystem::signal_create_mount, |
|
| 90 | + $storage->getMountPoint(), |
|
| 91 | + MountConfig::MOUNT_TYPE_USER, |
|
| 92 | + $this->userId |
|
| 93 | + ); |
|
| 94 | + |
|
| 95 | + $nextStorage = $this->service->addStorage($storage); |
|
| 96 | + $this->assertEquals($id + 1, $nextStorage->getId()); |
|
| 97 | + } |
|
| 98 | + |
|
| 99 | + public function testUpdateStorage(): void { |
|
| 100 | + $storage = $this->makeStorageConfig([ |
|
| 101 | + 'mountPoint' => 'mountpoint', |
|
| 102 | + 'backendIdentifier' => 'identifier:\OCA\Files_External\Lib\Backend\SMB', |
|
| 103 | + 'authMechanismIdentifier' => 'identifier:\Auth\Mechanism', |
|
| 104 | + 'backendOptions' => [ |
|
| 105 | + 'option1' => 'value1', |
|
| 106 | + 'option2' => 'value2', |
|
| 107 | + 'password' => 'testPassword', |
|
| 108 | + ], |
|
| 109 | + ]); |
|
| 110 | + |
|
| 111 | + $newStorage = $this->service->addStorage($storage); |
|
| 112 | + |
|
| 113 | + $backendOptions = $newStorage->getBackendOptions(); |
|
| 114 | + $backendOptions['password'] = 'anotherPassword'; |
|
| 115 | + $newStorage->setBackendOptions($backendOptions); |
|
| 116 | + |
|
| 117 | + self::$hookCalls = []; |
|
| 118 | + |
|
| 119 | + $newStorage = $this->service->updateStorage($newStorage); |
|
| 120 | + |
|
| 121 | + $this->assertEquals('anotherPassword', $newStorage->getBackendOptions()['password']); |
|
| 122 | + $this->assertEquals([$this->userId], $newStorage->getApplicableUsers()); |
|
| 123 | + // these attributes are unused for user storages |
|
| 124 | + $this->assertEmpty($newStorage->getApplicableGroups()); |
|
| 125 | + $this->assertEquals(0, $newStorage->getStatus()); |
|
| 126 | + |
|
| 127 | + // no hook calls |
|
| 128 | + $this->assertEmpty(self::$hookCalls); |
|
| 129 | + } |
|
| 130 | + |
|
| 131 | + #[\PHPUnit\Framework\Attributes\DataProvider('deleteStorageDataProvider')] |
|
| 132 | + public function testDeleteStorage($backendOptions, $rustyStorageId): void { |
|
| 133 | + parent::testDeleteStorage($backendOptions, $rustyStorageId); |
|
| 134 | + |
|
| 135 | + // hook called once for user (first one was during test creation) |
|
| 136 | + $this->assertHookCall( |
|
| 137 | + self::$hookCalls[1], |
|
| 138 | + Filesystem::signal_delete_mount, |
|
| 139 | + '/mountpoint', |
|
| 140 | + MountConfig::MOUNT_TYPE_USER, |
|
| 141 | + $this->userId |
|
| 142 | + ); |
|
| 143 | + } |
|
| 144 | + |
|
| 145 | + public function testHooksRenameMountPoint(): void { |
|
| 146 | + $storage = $this->makeTestStorageData(); |
|
| 147 | + $storage = $this->service->addStorage($storage); |
|
| 148 | + |
|
| 149 | + $storage->setMountPoint('renamedMountpoint'); |
|
| 150 | + |
|
| 151 | + // reset calls |
|
| 152 | + self::$hookCalls = []; |
|
| 153 | + |
|
| 154 | + $this->service->updateStorage($storage); |
|
| 155 | + |
|
| 156 | + // hook called twice |
|
| 157 | + $this->assertHookCall( |
|
| 158 | + self::$hookCalls[0], |
|
| 159 | + Filesystem::signal_delete_mount, |
|
| 160 | + '/mountpoint', |
|
| 161 | + MountConfig::MOUNT_TYPE_USER, |
|
| 162 | + $this->userId |
|
| 163 | + ); |
|
| 164 | + $this->assertHookCall( |
|
| 165 | + self::$hookCalls[1], |
|
| 166 | + Filesystem::signal_create_mount, |
|
| 167 | + '/renamedMountpoint', |
|
| 168 | + MountConfig::MOUNT_TYPE_USER, |
|
| 169 | + $this->userId |
|
| 170 | + ); |
|
| 171 | + } |
|
| 172 | + |
|
| 173 | + |
|
| 174 | + public function testGetAdminStorage(): void { |
|
| 175 | + $this->expectException(NotFoundException::class); |
|
| 176 | + |
|
| 177 | + $backend = $this->backendService->getBackend('identifier:\OCA\Files_External\Lib\Backend\SMB'); |
|
| 178 | + $authMechanism = $this->backendService->getAuthMechanism('identifier:\Auth\Mechanism'); |
|
| 179 | + |
|
| 180 | + $storage = new StorageConfig(); |
|
| 181 | + $storage->setMountPoint('mountpoint'); |
|
| 182 | + $storage->setBackend($backend); |
|
| 183 | + $storage->setAuthMechanism($authMechanism); |
|
| 184 | + $storage->setBackendOptions(['password' => 'testPassword']); |
|
| 185 | + $storage->setApplicableUsers([$this->userId]); |
|
| 186 | + |
|
| 187 | + $newStorage = $this->globalStoragesService->addStorage($storage); |
|
| 188 | + |
|
| 189 | + $this->assertInstanceOf('\OCA\Files_External\Lib\StorageConfig', $this->globalStoragesService->getStorage($newStorage->getId())); |
|
| 190 | + |
|
| 191 | + $this->service->getStorage($newStorage->getId()); |
|
| 192 | + } |
|
| 193 | 193 | } |
@@ -24,316 +24,316 @@ |
||
| 24 | 24 | * @group DB |
| 25 | 25 | */ |
| 26 | 26 | class UserGlobalStoragesServiceTest extends GlobalStoragesServiceTest { |
| 27 | - use UserTrait; |
|
| 28 | - |
|
| 29 | - protected IGroupManager&MockObject $groupManager; |
|
| 30 | - protected StoragesService $globalStoragesService; |
|
| 31 | - protected User $user; |
|
| 32 | - |
|
| 33 | - public const USER_ID = 'test_user'; |
|
| 34 | - public const GROUP_ID = 'test_group'; |
|
| 35 | - public const GROUP_ID2 = 'test_group2'; |
|
| 36 | - |
|
| 37 | - protected function setUp(): void { |
|
| 38 | - parent::setUp(); |
|
| 39 | - |
|
| 40 | - $this->globalStoragesService = $this->service; |
|
| 41 | - |
|
| 42 | - $this->user = new User(self::USER_ID, null, Server::get(IEventDispatcher::class)); |
|
| 43 | - /** @var IUserSession&MockObject $userSession */ |
|
| 44 | - $userSession = $this->createMock(IUserSession::class); |
|
| 45 | - $userSession |
|
| 46 | - ->expects($this->any()) |
|
| 47 | - ->method('getUser') |
|
| 48 | - ->willReturn($this->user); |
|
| 49 | - |
|
| 50 | - $this->groupManager = $this->createMock(IGroupManager::class); |
|
| 51 | - $this->groupManager->method('isInGroup') |
|
| 52 | - ->willReturnCallback(function ($userId, $groupId) { |
|
| 53 | - if ($userId === self::USER_ID) { |
|
| 54 | - switch ($groupId) { |
|
| 55 | - case self::GROUP_ID: |
|
| 56 | - case self::GROUP_ID2: |
|
| 57 | - return true; |
|
| 58 | - } |
|
| 59 | - } |
|
| 60 | - return false; |
|
| 61 | - }); |
|
| 62 | - $this->groupManager->method('getUserGroupIds') |
|
| 63 | - ->willReturnCallback(function (IUser $user) { |
|
| 64 | - if ($user->getUID() === self::USER_ID) { |
|
| 65 | - return [self::GROUP_ID, self::GROUP_ID2]; |
|
| 66 | - } else { |
|
| 67 | - return []; |
|
| 68 | - } |
|
| 69 | - }); |
|
| 70 | - |
|
| 71 | - $this->service = new UserGlobalStoragesService( |
|
| 72 | - $this->backendService, |
|
| 73 | - $this->dbConfig, |
|
| 74 | - $userSession, |
|
| 75 | - $this->groupManager, |
|
| 76 | - $this->mountCache, |
|
| 77 | - $this->eventDispatcher, |
|
| 78 | - $this->appConfig, |
|
| 79 | - ); |
|
| 80 | - } |
|
| 81 | - |
|
| 82 | - public static function applicableStorageProvider(): array { |
|
| 83 | - return [ |
|
| 84 | - [[], [], true], |
|
| 85 | - |
|
| 86 | - // not applicable cases |
|
| 87 | - [['user1'], [], false], |
|
| 88 | - [[], ['group1'], false], |
|
| 89 | - [['user1'], ['group1'], false], |
|
| 90 | - |
|
| 91 | - // applicable cases |
|
| 92 | - [[self::USER_ID], [], true], |
|
| 93 | - [[], [self::GROUP_ID], true], |
|
| 94 | - [[self::USER_ID], ['group1'], true], |
|
| 95 | - [['user1'], [self::GROUP_ID], true], |
|
| 96 | - |
|
| 97 | - // sanity checks |
|
| 98 | - [['user1', 'user2', self::USER_ID, 'user3'], [], true], |
|
| 99 | - ]; |
|
| 100 | - } |
|
| 101 | - |
|
| 102 | - #[\PHPUnit\Framework\Attributes\DataProvider('applicableStorageProvider')] |
|
| 103 | - public function testGetStorageWithApplicable($applicableUsers, $applicableGroups, $isVisible): void { |
|
| 104 | - $backend = $this->backendService->getBackend('identifier:\OCA\Files_External\Lib\Backend\SMB'); |
|
| 105 | - $authMechanism = $this->backendService->getAuthMechanism('identifier:\Auth\Mechanism'); |
|
| 106 | - |
|
| 107 | - $storage = new StorageConfig(); |
|
| 108 | - $storage->setMountPoint('mountpoint'); |
|
| 109 | - $storage->setBackend($backend); |
|
| 110 | - $storage->setAuthMechanism($authMechanism); |
|
| 111 | - $storage->setBackendOptions(['password' => 'testPassword']); |
|
| 112 | - $storage->setApplicableUsers($applicableUsers); |
|
| 113 | - $storage->setApplicableGroups($applicableGroups); |
|
| 114 | - |
|
| 115 | - $newStorage = $this->globalStoragesService->addStorage($storage); |
|
| 116 | - |
|
| 117 | - $storages = $this->service->getAllStorages(); |
|
| 118 | - if ($isVisible) { |
|
| 119 | - $this->assertEquals(1, count($storages)); |
|
| 120 | - $retrievedStorage = $this->service->getStorage($newStorage->getId()); |
|
| 121 | - $this->assertEquals('/mountpoint', $retrievedStorage->getMountPoint()); |
|
| 122 | - } else { |
|
| 123 | - $this->assertEquals(0, count($storages)); |
|
| 124 | - |
|
| 125 | - try { |
|
| 126 | - $this->service->getStorage($newStorage->getId()); |
|
| 127 | - $this->fail('Failed asserting that storage can\'t be accessed by id'); |
|
| 128 | - } catch (NotFoundException $e) { |
|
| 129 | - } |
|
| 130 | - } |
|
| 131 | - } |
|
| 132 | - |
|
| 133 | - |
|
| 134 | - public function testAddStorage($storageParams = null): void { |
|
| 135 | - $this->expectException(\DomainException::class); |
|
| 136 | - |
|
| 137 | - $backend = $this->backendService->getBackend('identifier:\OCA\Files_External\Lib\Backend\SMB'); |
|
| 138 | - $authMechanism = $this->backendService->getAuthMechanism('identifier:\Auth\Mechanism'); |
|
| 139 | - |
|
| 140 | - $storage = new StorageConfig(255); |
|
| 141 | - $storage->setMountPoint('mountpoint'); |
|
| 142 | - $storage->setBackend($backend); |
|
| 143 | - $storage->setAuthMechanism($authMechanism); |
|
| 144 | - $storage->setBackendOptions(['password' => 'testPassword']); |
|
| 145 | - |
|
| 146 | - $this->service->addStorage($storage); |
|
| 147 | - } |
|
| 148 | - |
|
| 149 | - |
|
| 150 | - public function testUpdateStorage($storageParams = null): void { |
|
| 151 | - $this->expectException(\DomainException::class); |
|
| 152 | - |
|
| 153 | - $backend = $this->backendService->getBackend('identifier:\OCA\Files_External\Lib\Backend\SMB'); |
|
| 154 | - $authMechanism = $this->backendService->getAuthMechanism('identifier:\Auth\Mechanism'); |
|
| 155 | - |
|
| 156 | - $storage = new StorageConfig(255); |
|
| 157 | - $storage->setMountPoint('mountpoint'); |
|
| 158 | - $storage->setBackend($backend); |
|
| 159 | - $storage->setAuthMechanism($authMechanism); |
|
| 160 | - $storage->setBackendOptions(['password' => 'testPassword']); |
|
| 161 | - |
|
| 162 | - $newStorage = $this->globalStoragesService->addStorage($storage); |
|
| 163 | - |
|
| 164 | - $retrievedStorage = $this->service->getStorage($newStorage->getId()); |
|
| 165 | - $retrievedStorage->setMountPoint('abc'); |
|
| 166 | - $this->service->updateStorage($retrievedStorage); |
|
| 167 | - } |
|
| 168 | - |
|
| 169 | - |
|
| 170 | - public function testNonExistingStorage(): void { |
|
| 171 | - $this->expectException(\DomainException::class); |
|
| 172 | - |
|
| 173 | - $this->ActualNonExistingStorageTest(); |
|
| 174 | - } |
|
| 175 | - |
|
| 176 | - #[\PHPUnit\Framework\Attributes\DataProvider('deleteStorageDataProvider')] |
|
| 177 | - public function testDeleteStorage($backendOptions, $rustyStorageId): void { |
|
| 178 | - $this->expectException(\DomainException::class); |
|
| 179 | - |
|
| 180 | - $backend = $this->backendService->getBackend('identifier:\OCA\Files_External\Lib\Backend\SMB'); |
|
| 181 | - $authMechanism = $this->backendService->getAuthMechanism('identifier:\Auth\Mechanism'); |
|
| 182 | - |
|
| 183 | - $storage = new StorageConfig(255); |
|
| 184 | - $storage->setMountPoint('mountpoint'); |
|
| 185 | - $storage->setBackend($backend); |
|
| 186 | - $storage->setAuthMechanism($authMechanism); |
|
| 187 | - $storage->setBackendOptions($backendOptions); |
|
| 188 | - |
|
| 189 | - $newStorage = $this->globalStoragesService->addStorage($storage); |
|
| 190 | - $id = $newStorage->getId(); |
|
| 191 | - |
|
| 192 | - $this->service->removeStorage($id); |
|
| 193 | - } |
|
| 194 | - |
|
| 195 | - |
|
| 196 | - public function testDeleteUnexistingStorage(): void { |
|
| 197 | - $this->expectException(\DomainException::class); |
|
| 198 | - |
|
| 199 | - $this->actualDeletedUnexistingStorageTest(); |
|
| 200 | - } |
|
| 201 | - |
|
| 202 | - public static function getUniqueStoragesProvider(): array { |
|
| 203 | - return [ |
|
| 204 | - // 'all' vs group |
|
| 205 | - [100, [], [], 100, [], [self::GROUP_ID], 2], |
|
| 206 | - [100, [], [self::GROUP_ID], 100, [], [], 1], |
|
| 207 | - |
|
| 208 | - // 'all' vs user |
|
| 209 | - [100, [], [], 100, [self::USER_ID], [], 2], |
|
| 210 | - [100, [self::USER_ID], [], 100, [], [], 1], |
|
| 211 | - |
|
| 212 | - // group vs user |
|
| 213 | - [100, [], [self::GROUP_ID], 100, [self::USER_ID], [], 2], |
|
| 214 | - [100, [self::USER_ID], [], 100, [], [self::GROUP_ID], 1], |
|
| 215 | - |
|
| 216 | - // group+user vs group |
|
| 217 | - [100, [], [self::GROUP_ID2], 100, [self::USER_ID], [self::GROUP_ID], 2], |
|
| 218 | - [100, [self::USER_ID], [self::GROUP_ID], 100, [], [self::GROUP_ID2], 1], |
|
| 219 | - |
|
| 220 | - // user vs 'all' (higher priority) |
|
| 221 | - [200, [], [], 100, [self::USER_ID], [], 2], |
|
| 222 | - [100, [self::USER_ID], [], 200, [], [], 1], |
|
| 223 | - |
|
| 224 | - // group vs group (higher priority) |
|
| 225 | - [100, [], [self::GROUP_ID2], 200, [], [self::GROUP_ID], 2], |
|
| 226 | - [200, [], [self::GROUP_ID], 100, [], [self::GROUP_ID2], 1], |
|
| 227 | - ]; |
|
| 228 | - } |
|
| 229 | - |
|
| 230 | - #[\PHPUnit\Framework\Attributes\DataProvider('getUniqueStoragesProvider')] |
|
| 231 | - public function testGetUniqueStorages( |
|
| 232 | - $priority1, $applicableUsers1, $applicableGroups1, |
|
| 233 | - $priority2, $applicableUsers2, $applicableGroups2, |
|
| 234 | - $expectedPrecedence, |
|
| 235 | - ): void { |
|
| 236 | - $backend = $this->backendService->getBackend('identifier:\OCA\Files_External\Lib\Backend\SMB'); |
|
| 237 | - $backend->method('isVisibleFor') |
|
| 238 | - ->willReturn(true); |
|
| 239 | - $authMechanism = $this->backendService->getAuthMechanism('identifier:\Auth\Mechanism'); |
|
| 240 | - $authMechanism->method('isVisibleFor') |
|
| 241 | - ->willReturn(true); |
|
| 242 | - |
|
| 243 | - $storage1 = new StorageConfig(); |
|
| 244 | - $storage1->setMountPoint('mountpoint'); |
|
| 245 | - $storage1->setBackend($backend); |
|
| 246 | - $storage1->setAuthMechanism($authMechanism); |
|
| 247 | - $storage1->setBackendOptions(['password' => 'testPassword']); |
|
| 248 | - $storage1->setPriority($priority1); |
|
| 249 | - $storage1->setApplicableUsers($applicableUsers1); |
|
| 250 | - $storage1->setApplicableGroups($applicableGroups1); |
|
| 251 | - |
|
| 252 | - $storage1 = $this->globalStoragesService->addStorage($storage1); |
|
| 253 | - |
|
| 254 | - $storage2 = new StorageConfig(); |
|
| 255 | - $storage2->setMountPoint('mountpoint'); |
|
| 256 | - $storage2->setBackend($backend); |
|
| 257 | - $storage2->setAuthMechanism($authMechanism); |
|
| 258 | - $storage2->setBackendOptions(['password' => 'testPassword']); |
|
| 259 | - $storage2->setPriority($priority2); |
|
| 260 | - $storage2->setApplicableUsers($applicableUsers2); |
|
| 261 | - $storage2->setApplicableGroups($applicableGroups2); |
|
| 262 | - |
|
| 263 | - $storage2 = $this->globalStoragesService->addStorage($storage2); |
|
| 264 | - |
|
| 265 | - $storages = $this->service->getUniqueStorages(); |
|
| 266 | - $this->assertCount(1, $storages); |
|
| 267 | - |
|
| 268 | - if ($expectedPrecedence === 1) { |
|
| 269 | - $this->assertArrayHasKey($storage1->getID(), $storages); |
|
| 270 | - } elseif ($expectedPrecedence === 2) { |
|
| 271 | - $this->assertArrayHasKey($storage2->getID(), $storages); |
|
| 272 | - } |
|
| 273 | - } |
|
| 274 | - |
|
| 275 | - public function testGetStoragesBackendNotVisible(): void { |
|
| 276 | - // we don't test this here |
|
| 277 | - $this->addToAssertionCount(1); |
|
| 278 | - } |
|
| 279 | - |
|
| 280 | - public function testGetStoragesAuthMechanismNotVisible(): void { |
|
| 281 | - // we don't test this here |
|
| 282 | - $this->addToAssertionCount(1); |
|
| 283 | - } |
|
| 284 | - |
|
| 285 | - public function testHooksAddStorage($a = null, $b = null, $c = null): void { |
|
| 286 | - // we don't test this here |
|
| 287 | - $this->addToAssertionCount(1); |
|
| 288 | - } |
|
| 289 | - |
|
| 290 | - public function testHooksUpdateStorage($a = null, $b = null, $c = null, $d = null, $e = null): void { |
|
| 291 | - // we don't test this here |
|
| 292 | - $this->addToAssertionCount(1); |
|
| 293 | - } |
|
| 294 | - |
|
| 295 | - public function testHooksRenameMountPoint(): void { |
|
| 296 | - // we don't test this here |
|
| 297 | - $this->addToAssertionCount(1); |
|
| 298 | - } |
|
| 299 | - |
|
| 300 | - public function testHooksDeleteStorage($a = null, $b = null, $c = null): void { |
|
| 301 | - // we don't test this here |
|
| 302 | - $this->addToAssertionCount(1); |
|
| 303 | - } |
|
| 304 | - |
|
| 305 | - public function testLegacyConfigConversionApplicableAll(): void { |
|
| 306 | - // we don't test this here |
|
| 307 | - $this->addToAssertionCount(1); |
|
| 308 | - } |
|
| 309 | - |
|
| 310 | - public function testLegacyConfigConversionApplicableUserAndGroup(): void { |
|
| 311 | - // we don't test this here |
|
| 312 | - $this->addToAssertionCount(1); |
|
| 313 | - } |
|
| 314 | - |
|
| 315 | - public function testReadLegacyConfigAndGenerateConfigId(): void { |
|
| 316 | - // we don't test this here |
|
| 317 | - $this->addToAssertionCount(1); |
|
| 318 | - } |
|
| 319 | - |
|
| 320 | - public function testReadLegacyConfigNoAuthMechanism(): void { |
|
| 321 | - // we don't test this here |
|
| 322 | - $this->addToAssertionCount(1); |
|
| 323 | - } |
|
| 324 | - |
|
| 325 | - public function testReadLegacyConfigClass(): void { |
|
| 326 | - // we don't test this here |
|
| 327 | - $this->addToAssertionCount(1); |
|
| 328 | - } |
|
| 329 | - |
|
| 330 | - public function testReadEmptyMountPoint(): void { |
|
| 331 | - // we don't test this here |
|
| 332 | - $this->addToAssertionCount(1); |
|
| 333 | - } |
|
| 334 | - |
|
| 335 | - public function testUpdateStorageMountPoint(): void { |
|
| 336 | - // we don't test this here |
|
| 337 | - $this->addToAssertionCount(1); |
|
| 338 | - } |
|
| 27 | + use UserTrait; |
|
| 28 | + |
|
| 29 | + protected IGroupManager&MockObject $groupManager; |
|
| 30 | + protected StoragesService $globalStoragesService; |
|
| 31 | + protected User $user; |
|
| 32 | + |
|
| 33 | + public const USER_ID = 'test_user'; |
|
| 34 | + public const GROUP_ID = 'test_group'; |
|
| 35 | + public const GROUP_ID2 = 'test_group2'; |
|
| 36 | + |
|
| 37 | + protected function setUp(): void { |
|
| 38 | + parent::setUp(); |
|
| 39 | + |
|
| 40 | + $this->globalStoragesService = $this->service; |
|
| 41 | + |
|
| 42 | + $this->user = new User(self::USER_ID, null, Server::get(IEventDispatcher::class)); |
|
| 43 | + /** @var IUserSession&MockObject $userSession */ |
|
| 44 | + $userSession = $this->createMock(IUserSession::class); |
|
| 45 | + $userSession |
|
| 46 | + ->expects($this->any()) |
|
| 47 | + ->method('getUser') |
|
| 48 | + ->willReturn($this->user); |
|
| 49 | + |
|
| 50 | + $this->groupManager = $this->createMock(IGroupManager::class); |
|
| 51 | + $this->groupManager->method('isInGroup') |
|
| 52 | + ->willReturnCallback(function ($userId, $groupId) { |
|
| 53 | + if ($userId === self::USER_ID) { |
|
| 54 | + switch ($groupId) { |
|
| 55 | + case self::GROUP_ID: |
|
| 56 | + case self::GROUP_ID2: |
|
| 57 | + return true; |
|
| 58 | + } |
|
| 59 | + } |
|
| 60 | + return false; |
|
| 61 | + }); |
|
| 62 | + $this->groupManager->method('getUserGroupIds') |
|
| 63 | + ->willReturnCallback(function (IUser $user) { |
|
| 64 | + if ($user->getUID() === self::USER_ID) { |
|
| 65 | + return [self::GROUP_ID, self::GROUP_ID2]; |
|
| 66 | + } else { |
|
| 67 | + return []; |
|
| 68 | + } |
|
| 69 | + }); |
|
| 70 | + |
|
| 71 | + $this->service = new UserGlobalStoragesService( |
|
| 72 | + $this->backendService, |
|
| 73 | + $this->dbConfig, |
|
| 74 | + $userSession, |
|
| 75 | + $this->groupManager, |
|
| 76 | + $this->mountCache, |
|
| 77 | + $this->eventDispatcher, |
|
| 78 | + $this->appConfig, |
|
| 79 | + ); |
|
| 80 | + } |
|
| 81 | + |
|
| 82 | + public static function applicableStorageProvider(): array { |
|
| 83 | + return [ |
|
| 84 | + [[], [], true], |
|
| 85 | + |
|
| 86 | + // not applicable cases |
|
| 87 | + [['user1'], [], false], |
|
| 88 | + [[], ['group1'], false], |
|
| 89 | + [['user1'], ['group1'], false], |
|
| 90 | + |
|
| 91 | + // applicable cases |
|
| 92 | + [[self::USER_ID], [], true], |
|
| 93 | + [[], [self::GROUP_ID], true], |
|
| 94 | + [[self::USER_ID], ['group1'], true], |
|
| 95 | + [['user1'], [self::GROUP_ID], true], |
|
| 96 | + |
|
| 97 | + // sanity checks |
|
| 98 | + [['user1', 'user2', self::USER_ID, 'user3'], [], true], |
|
| 99 | + ]; |
|
| 100 | + } |
|
| 101 | + |
|
| 102 | + #[\PHPUnit\Framework\Attributes\DataProvider('applicableStorageProvider')] |
|
| 103 | + public function testGetStorageWithApplicable($applicableUsers, $applicableGroups, $isVisible): void { |
|
| 104 | + $backend = $this->backendService->getBackend('identifier:\OCA\Files_External\Lib\Backend\SMB'); |
|
| 105 | + $authMechanism = $this->backendService->getAuthMechanism('identifier:\Auth\Mechanism'); |
|
| 106 | + |
|
| 107 | + $storage = new StorageConfig(); |
|
| 108 | + $storage->setMountPoint('mountpoint'); |
|
| 109 | + $storage->setBackend($backend); |
|
| 110 | + $storage->setAuthMechanism($authMechanism); |
|
| 111 | + $storage->setBackendOptions(['password' => 'testPassword']); |
|
| 112 | + $storage->setApplicableUsers($applicableUsers); |
|
| 113 | + $storage->setApplicableGroups($applicableGroups); |
|
| 114 | + |
|
| 115 | + $newStorage = $this->globalStoragesService->addStorage($storage); |
|
| 116 | + |
|
| 117 | + $storages = $this->service->getAllStorages(); |
|
| 118 | + if ($isVisible) { |
|
| 119 | + $this->assertEquals(1, count($storages)); |
|
| 120 | + $retrievedStorage = $this->service->getStorage($newStorage->getId()); |
|
| 121 | + $this->assertEquals('/mountpoint', $retrievedStorage->getMountPoint()); |
|
| 122 | + } else { |
|
| 123 | + $this->assertEquals(0, count($storages)); |
|
| 124 | + |
|
| 125 | + try { |
|
| 126 | + $this->service->getStorage($newStorage->getId()); |
|
| 127 | + $this->fail('Failed asserting that storage can\'t be accessed by id'); |
|
| 128 | + } catch (NotFoundException $e) { |
|
| 129 | + } |
|
| 130 | + } |
|
| 131 | + } |
|
| 132 | + |
|
| 133 | + |
|
| 134 | + public function testAddStorage($storageParams = null): void { |
|
| 135 | + $this->expectException(\DomainException::class); |
|
| 136 | + |
|
| 137 | + $backend = $this->backendService->getBackend('identifier:\OCA\Files_External\Lib\Backend\SMB'); |
|
| 138 | + $authMechanism = $this->backendService->getAuthMechanism('identifier:\Auth\Mechanism'); |
|
| 139 | + |
|
| 140 | + $storage = new StorageConfig(255); |
|
| 141 | + $storage->setMountPoint('mountpoint'); |
|
| 142 | + $storage->setBackend($backend); |
|
| 143 | + $storage->setAuthMechanism($authMechanism); |
|
| 144 | + $storage->setBackendOptions(['password' => 'testPassword']); |
|
| 145 | + |
|
| 146 | + $this->service->addStorage($storage); |
|
| 147 | + } |
|
| 148 | + |
|
| 149 | + |
|
| 150 | + public function testUpdateStorage($storageParams = null): void { |
|
| 151 | + $this->expectException(\DomainException::class); |
|
| 152 | + |
|
| 153 | + $backend = $this->backendService->getBackend('identifier:\OCA\Files_External\Lib\Backend\SMB'); |
|
| 154 | + $authMechanism = $this->backendService->getAuthMechanism('identifier:\Auth\Mechanism'); |
|
| 155 | + |
|
| 156 | + $storage = new StorageConfig(255); |
|
| 157 | + $storage->setMountPoint('mountpoint'); |
|
| 158 | + $storage->setBackend($backend); |
|
| 159 | + $storage->setAuthMechanism($authMechanism); |
|
| 160 | + $storage->setBackendOptions(['password' => 'testPassword']); |
|
| 161 | + |
|
| 162 | + $newStorage = $this->globalStoragesService->addStorage($storage); |
|
| 163 | + |
|
| 164 | + $retrievedStorage = $this->service->getStorage($newStorage->getId()); |
|
| 165 | + $retrievedStorage->setMountPoint('abc'); |
|
| 166 | + $this->service->updateStorage($retrievedStorage); |
|
| 167 | + } |
|
| 168 | + |
|
| 169 | + |
|
| 170 | + public function testNonExistingStorage(): void { |
|
| 171 | + $this->expectException(\DomainException::class); |
|
| 172 | + |
|
| 173 | + $this->ActualNonExistingStorageTest(); |
|
| 174 | + } |
|
| 175 | + |
|
| 176 | + #[\PHPUnit\Framework\Attributes\DataProvider('deleteStorageDataProvider')] |
|
| 177 | + public function testDeleteStorage($backendOptions, $rustyStorageId): void { |
|
| 178 | + $this->expectException(\DomainException::class); |
|
| 179 | + |
|
| 180 | + $backend = $this->backendService->getBackend('identifier:\OCA\Files_External\Lib\Backend\SMB'); |
|
| 181 | + $authMechanism = $this->backendService->getAuthMechanism('identifier:\Auth\Mechanism'); |
|
| 182 | + |
|
| 183 | + $storage = new StorageConfig(255); |
|
| 184 | + $storage->setMountPoint('mountpoint'); |
|
| 185 | + $storage->setBackend($backend); |
|
| 186 | + $storage->setAuthMechanism($authMechanism); |
|
| 187 | + $storage->setBackendOptions($backendOptions); |
|
| 188 | + |
|
| 189 | + $newStorage = $this->globalStoragesService->addStorage($storage); |
|
| 190 | + $id = $newStorage->getId(); |
|
| 191 | + |
|
| 192 | + $this->service->removeStorage($id); |
|
| 193 | + } |
|
| 194 | + |
|
| 195 | + |
|
| 196 | + public function testDeleteUnexistingStorage(): void { |
|
| 197 | + $this->expectException(\DomainException::class); |
|
| 198 | + |
|
| 199 | + $this->actualDeletedUnexistingStorageTest(); |
|
| 200 | + } |
|
| 201 | + |
|
| 202 | + public static function getUniqueStoragesProvider(): array { |
|
| 203 | + return [ |
|
| 204 | + // 'all' vs group |
|
| 205 | + [100, [], [], 100, [], [self::GROUP_ID], 2], |
|
| 206 | + [100, [], [self::GROUP_ID], 100, [], [], 1], |
|
| 207 | + |
|
| 208 | + // 'all' vs user |
|
| 209 | + [100, [], [], 100, [self::USER_ID], [], 2], |
|
| 210 | + [100, [self::USER_ID], [], 100, [], [], 1], |
|
| 211 | + |
|
| 212 | + // group vs user |
|
| 213 | + [100, [], [self::GROUP_ID], 100, [self::USER_ID], [], 2], |
|
| 214 | + [100, [self::USER_ID], [], 100, [], [self::GROUP_ID], 1], |
|
| 215 | + |
|
| 216 | + // group+user vs group |
|
| 217 | + [100, [], [self::GROUP_ID2], 100, [self::USER_ID], [self::GROUP_ID], 2], |
|
| 218 | + [100, [self::USER_ID], [self::GROUP_ID], 100, [], [self::GROUP_ID2], 1], |
|
| 219 | + |
|
| 220 | + // user vs 'all' (higher priority) |
|
| 221 | + [200, [], [], 100, [self::USER_ID], [], 2], |
|
| 222 | + [100, [self::USER_ID], [], 200, [], [], 1], |
|
| 223 | + |
|
| 224 | + // group vs group (higher priority) |
|
| 225 | + [100, [], [self::GROUP_ID2], 200, [], [self::GROUP_ID], 2], |
|
| 226 | + [200, [], [self::GROUP_ID], 100, [], [self::GROUP_ID2], 1], |
|
| 227 | + ]; |
|
| 228 | + } |
|
| 229 | + |
|
| 230 | + #[\PHPUnit\Framework\Attributes\DataProvider('getUniqueStoragesProvider')] |
|
| 231 | + public function testGetUniqueStorages( |
|
| 232 | + $priority1, $applicableUsers1, $applicableGroups1, |
|
| 233 | + $priority2, $applicableUsers2, $applicableGroups2, |
|
| 234 | + $expectedPrecedence, |
|
| 235 | + ): void { |
|
| 236 | + $backend = $this->backendService->getBackend('identifier:\OCA\Files_External\Lib\Backend\SMB'); |
|
| 237 | + $backend->method('isVisibleFor') |
|
| 238 | + ->willReturn(true); |
|
| 239 | + $authMechanism = $this->backendService->getAuthMechanism('identifier:\Auth\Mechanism'); |
|
| 240 | + $authMechanism->method('isVisibleFor') |
|
| 241 | + ->willReturn(true); |
|
| 242 | + |
|
| 243 | + $storage1 = new StorageConfig(); |
|
| 244 | + $storage1->setMountPoint('mountpoint'); |
|
| 245 | + $storage1->setBackend($backend); |
|
| 246 | + $storage1->setAuthMechanism($authMechanism); |
|
| 247 | + $storage1->setBackendOptions(['password' => 'testPassword']); |
|
| 248 | + $storage1->setPriority($priority1); |
|
| 249 | + $storage1->setApplicableUsers($applicableUsers1); |
|
| 250 | + $storage1->setApplicableGroups($applicableGroups1); |
|
| 251 | + |
|
| 252 | + $storage1 = $this->globalStoragesService->addStorage($storage1); |
|
| 253 | + |
|
| 254 | + $storage2 = new StorageConfig(); |
|
| 255 | + $storage2->setMountPoint('mountpoint'); |
|
| 256 | + $storage2->setBackend($backend); |
|
| 257 | + $storage2->setAuthMechanism($authMechanism); |
|
| 258 | + $storage2->setBackendOptions(['password' => 'testPassword']); |
|
| 259 | + $storage2->setPriority($priority2); |
|
| 260 | + $storage2->setApplicableUsers($applicableUsers2); |
|
| 261 | + $storage2->setApplicableGroups($applicableGroups2); |
|
| 262 | + |
|
| 263 | + $storage2 = $this->globalStoragesService->addStorage($storage2); |
|
| 264 | + |
|
| 265 | + $storages = $this->service->getUniqueStorages(); |
|
| 266 | + $this->assertCount(1, $storages); |
|
| 267 | + |
|
| 268 | + if ($expectedPrecedence === 1) { |
|
| 269 | + $this->assertArrayHasKey($storage1->getID(), $storages); |
|
| 270 | + } elseif ($expectedPrecedence === 2) { |
|
| 271 | + $this->assertArrayHasKey($storage2->getID(), $storages); |
|
| 272 | + } |
|
| 273 | + } |
|
| 274 | + |
|
| 275 | + public function testGetStoragesBackendNotVisible(): void { |
|
| 276 | + // we don't test this here |
|
| 277 | + $this->addToAssertionCount(1); |
|
| 278 | + } |
|
| 279 | + |
|
| 280 | + public function testGetStoragesAuthMechanismNotVisible(): void { |
|
| 281 | + // we don't test this here |
|
| 282 | + $this->addToAssertionCount(1); |
|
| 283 | + } |
|
| 284 | + |
|
| 285 | + public function testHooksAddStorage($a = null, $b = null, $c = null): void { |
|
| 286 | + // we don't test this here |
|
| 287 | + $this->addToAssertionCount(1); |
|
| 288 | + } |
|
| 289 | + |
|
| 290 | + public function testHooksUpdateStorage($a = null, $b = null, $c = null, $d = null, $e = null): void { |
|
| 291 | + // we don't test this here |
|
| 292 | + $this->addToAssertionCount(1); |
|
| 293 | + } |
|
| 294 | + |
|
| 295 | + public function testHooksRenameMountPoint(): void { |
|
| 296 | + // we don't test this here |
|
| 297 | + $this->addToAssertionCount(1); |
|
| 298 | + } |
|
| 299 | + |
|
| 300 | + public function testHooksDeleteStorage($a = null, $b = null, $c = null): void { |
|
| 301 | + // we don't test this here |
|
| 302 | + $this->addToAssertionCount(1); |
|
| 303 | + } |
|
| 304 | + |
|
| 305 | + public function testLegacyConfigConversionApplicableAll(): void { |
|
| 306 | + // we don't test this here |
|
| 307 | + $this->addToAssertionCount(1); |
|
| 308 | + } |
|
| 309 | + |
|
| 310 | + public function testLegacyConfigConversionApplicableUserAndGroup(): void { |
|
| 311 | + // we don't test this here |
|
| 312 | + $this->addToAssertionCount(1); |
|
| 313 | + } |
|
| 314 | + |
|
| 315 | + public function testReadLegacyConfigAndGenerateConfigId(): void { |
|
| 316 | + // we don't test this here |
|
| 317 | + $this->addToAssertionCount(1); |
|
| 318 | + } |
|
| 319 | + |
|
| 320 | + public function testReadLegacyConfigNoAuthMechanism(): void { |
|
| 321 | + // we don't test this here |
|
| 322 | + $this->addToAssertionCount(1); |
|
| 323 | + } |
|
| 324 | + |
|
| 325 | + public function testReadLegacyConfigClass(): void { |
|
| 326 | + // we don't test this here |
|
| 327 | + $this->addToAssertionCount(1); |
|
| 328 | + } |
|
| 329 | + |
|
| 330 | + public function testReadEmptyMountPoint(): void { |
|
| 331 | + // we don't test this here |
|
| 332 | + $this->addToAssertionCount(1); |
|
| 333 | + } |
|
| 334 | + |
|
| 335 | + public function testUpdateStorageMountPoint(): void { |
|
| 336 | + // we don't test this here |
|
| 337 | + $this->addToAssertionCount(1); |
|
| 338 | + } |
|
| 339 | 339 | } |
@@ -6,123 +6,123 @@ |
||
| 6 | 6 | $baseDir = $vendorDir; |
| 7 | 7 | |
| 8 | 8 | return array( |
| 9 | - 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', |
|
| 10 | - 'OCA\\Files_External\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php', |
|
| 11 | - 'OCA\\Files_External\\BackgroundJob\\CredentialsCleanup' => $baseDir . '/../lib/BackgroundJob/CredentialsCleanup.php', |
|
| 12 | - 'OCA\\Files_External\\Command\\Applicable' => $baseDir . '/../lib/Command/Applicable.php', |
|
| 13 | - 'OCA\\Files_External\\Command\\Backends' => $baseDir . '/../lib/Command/Backends.php', |
|
| 14 | - 'OCA\\Files_External\\Command\\Config' => $baseDir . '/../lib/Command/Config.php', |
|
| 15 | - 'OCA\\Files_External\\Command\\Create' => $baseDir . '/../lib/Command/Create.php', |
|
| 16 | - 'OCA\\Files_External\\Command\\Delete' => $baseDir . '/../lib/Command/Delete.php', |
|
| 17 | - 'OCA\\Files_External\\Command\\Dependencies' => $baseDir . '/../lib/Command/Dependencies.php', |
|
| 18 | - 'OCA\\Files_External\\Command\\Export' => $baseDir . '/../lib/Command/Export.php', |
|
| 19 | - 'OCA\\Files_External\\Command\\Import' => $baseDir . '/../lib/Command/Import.php', |
|
| 20 | - 'OCA\\Files_External\\Command\\ListCommand' => $baseDir . '/../lib/Command/ListCommand.php', |
|
| 21 | - 'OCA\\Files_External\\Command\\Notify' => $baseDir . '/../lib/Command/Notify.php', |
|
| 22 | - 'OCA\\Files_External\\Command\\Option' => $baseDir . '/../lib/Command/Option.php', |
|
| 23 | - 'OCA\\Files_External\\Command\\Scan' => $baseDir . '/../lib/Command/Scan.php', |
|
| 24 | - 'OCA\\Files_External\\Command\\StorageAuthBase' => $baseDir . '/../lib/Command/StorageAuthBase.php', |
|
| 25 | - 'OCA\\Files_External\\Command\\Verify' => $baseDir . '/../lib/Command/Verify.php', |
|
| 26 | - 'OCA\\Files_External\\ConfigLexicon' => $baseDir . '/../lib/ConfigLexicon.php', |
|
| 27 | - 'OCA\\Files_External\\Config\\ConfigAdapter' => $baseDir . '/../lib/Config/ConfigAdapter.php', |
|
| 28 | - 'OCA\\Files_External\\Config\\ExternalMountPoint' => $baseDir . '/../lib/Config/ExternalMountPoint.php', |
|
| 29 | - 'OCA\\Files_External\\Config\\IConfigHandler' => $baseDir . '/../lib/Config/IConfigHandler.php', |
|
| 30 | - 'OCA\\Files_External\\Config\\SimpleSubstitutionTrait' => $baseDir . '/../lib/Config/SimpleSubstitutionTrait.php', |
|
| 31 | - 'OCA\\Files_External\\Config\\SystemMountPoint' => $baseDir . '/../lib/Config/SystemMountPoint.php', |
|
| 32 | - 'OCA\\Files_External\\Config\\UserContext' => $baseDir . '/../lib/Config/UserContext.php', |
|
| 33 | - 'OCA\\Files_External\\Config\\UserPlaceholderHandler' => $baseDir . '/../lib/Config/UserPlaceholderHandler.php', |
|
| 34 | - 'OCA\\Files_External\\Controller\\AjaxController' => $baseDir . '/../lib/Controller/AjaxController.php', |
|
| 35 | - 'OCA\\Files_External\\Controller\\ApiController' => $baseDir . '/../lib/Controller/ApiController.php', |
|
| 36 | - 'OCA\\Files_External\\Controller\\GlobalStoragesController' => $baseDir . '/../lib/Controller/GlobalStoragesController.php', |
|
| 37 | - 'OCA\\Files_External\\Controller\\StoragesController' => $baseDir . '/../lib/Controller/StoragesController.php', |
|
| 38 | - 'OCA\\Files_External\\Controller\\UserGlobalStoragesController' => $baseDir . '/../lib/Controller/UserGlobalStoragesController.php', |
|
| 39 | - 'OCA\\Files_External\\Controller\\UserStoragesController' => $baseDir . '/../lib/Controller/UserStoragesController.php', |
|
| 40 | - 'OCA\\Files_External\\Lib\\Auth\\AmazonS3\\AccessKey' => $baseDir . '/../lib/Lib/Auth/AmazonS3/AccessKey.php', |
|
| 41 | - 'OCA\\Files_External\\Lib\\Auth\\AuthMechanism' => $baseDir . '/../lib/Lib/Auth/AuthMechanism.php', |
|
| 42 | - 'OCA\\Files_External\\Lib\\Auth\\Builtin' => $baseDir . '/../lib/Lib/Auth/Builtin.php', |
|
| 43 | - 'OCA\\Files_External\\Lib\\Auth\\IUserProvided' => $baseDir . '/../lib/Lib/Auth/IUserProvided.php', |
|
| 44 | - 'OCA\\Files_External\\Lib\\Auth\\InvalidAuth' => $baseDir . '/../lib/Lib/Auth/InvalidAuth.php', |
|
| 45 | - 'OCA\\Files_External\\Lib\\Auth\\NullMechanism' => $baseDir . '/../lib/Lib/Auth/NullMechanism.php', |
|
| 46 | - 'OCA\\Files_External\\Lib\\Auth\\OAuth2\\OAuth2' => $baseDir . '/../lib/Lib/Auth/OAuth2/OAuth2.php', |
|
| 47 | - 'OCA\\Files_External\\Lib\\Auth\\OpenStack\\OpenStackV2' => $baseDir . '/../lib/Lib/Auth/OpenStack/OpenStackV2.php', |
|
| 48 | - 'OCA\\Files_External\\Lib\\Auth\\OpenStack\\OpenStackV3' => $baseDir . '/../lib/Lib/Auth/OpenStack/OpenStackV3.php', |
|
| 49 | - 'OCA\\Files_External\\Lib\\Auth\\OpenStack\\Rackspace' => $baseDir . '/../lib/Lib/Auth/OpenStack/Rackspace.php', |
|
| 50 | - 'OCA\\Files_External\\Lib\\Auth\\Password\\GlobalAuth' => $baseDir . '/../lib/Lib/Auth/Password/GlobalAuth.php', |
|
| 51 | - 'OCA\\Files_External\\Lib\\Auth\\Password\\LoginCredentials' => $baseDir . '/../lib/Lib/Auth/Password/LoginCredentials.php', |
|
| 52 | - 'OCA\\Files_External\\Lib\\Auth\\Password\\Password' => $baseDir . '/../lib/Lib/Auth/Password/Password.php', |
|
| 53 | - 'OCA\\Files_External\\Lib\\Auth\\Password\\SessionCredentials' => $baseDir . '/../lib/Lib/Auth/Password/SessionCredentials.php', |
|
| 54 | - 'OCA\\Files_External\\Lib\\Auth\\Password\\UserGlobalAuth' => $baseDir . '/../lib/Lib/Auth/Password/UserGlobalAuth.php', |
|
| 55 | - 'OCA\\Files_External\\Lib\\Auth\\Password\\UserProvided' => $baseDir . '/../lib/Lib/Auth/Password/UserProvided.php', |
|
| 56 | - 'OCA\\Files_External\\Lib\\Auth\\PublicKey\\RSA' => $baseDir . '/../lib/Lib/Auth/PublicKey/RSA.php', |
|
| 57 | - 'OCA\\Files_External\\Lib\\Auth\\PublicKey\\RSAPrivateKey' => $baseDir . '/../lib/Lib/Auth/PublicKey/RSAPrivateKey.php', |
|
| 58 | - 'OCA\\Files_External\\Lib\\Auth\\SMB\\KerberosApacheAuth' => $baseDir . '/../lib/Lib/Auth/SMB/KerberosApacheAuth.php', |
|
| 59 | - 'OCA\\Files_External\\Lib\\Auth\\SMB\\KerberosAuth' => $baseDir . '/../lib/Lib/Auth/SMB/KerberosAuth.php', |
|
| 60 | - 'OCA\\Files_External\\Lib\\Backend\\AmazonS3' => $baseDir . '/../lib/Lib/Backend/AmazonS3.php', |
|
| 61 | - 'OCA\\Files_External\\Lib\\Backend\\Backend' => $baseDir . '/../lib/Lib/Backend/Backend.php', |
|
| 62 | - 'OCA\\Files_External\\Lib\\Backend\\DAV' => $baseDir . '/../lib/Lib/Backend/DAV.php', |
|
| 63 | - 'OCA\\Files_External\\Lib\\Backend\\FTP' => $baseDir . '/../lib/Lib/Backend/FTP.php', |
|
| 64 | - 'OCA\\Files_External\\Lib\\Backend\\InvalidBackend' => $baseDir . '/../lib/Lib/Backend/InvalidBackend.php', |
|
| 65 | - 'OCA\\Files_External\\Lib\\Backend\\LegacyBackend' => $baseDir . '/../lib/Lib/Backend/LegacyBackend.php', |
|
| 66 | - 'OCA\\Files_External\\Lib\\Backend\\Local' => $baseDir . '/../lib/Lib/Backend/Local.php', |
|
| 67 | - 'OCA\\Files_External\\Lib\\Backend\\OwnCloud' => $baseDir . '/../lib/Lib/Backend/OwnCloud.php', |
|
| 68 | - 'OCA\\Files_External\\Lib\\Backend\\SFTP' => $baseDir . '/../lib/Lib/Backend/SFTP.php', |
|
| 69 | - 'OCA\\Files_External\\Lib\\Backend\\SFTP_Key' => $baseDir . '/../lib/Lib/Backend/SFTP_Key.php', |
|
| 70 | - 'OCA\\Files_External\\Lib\\Backend\\SMB' => $baseDir . '/../lib/Lib/Backend/SMB.php', |
|
| 71 | - 'OCA\\Files_External\\Lib\\Backend\\SMB_OC' => $baseDir . '/../lib/Lib/Backend/SMB_OC.php', |
|
| 72 | - 'OCA\\Files_External\\Lib\\Backend\\Swift' => $baseDir . '/../lib/Lib/Backend/Swift.php', |
|
| 73 | - 'OCA\\Files_External\\Lib\\Config\\IAuthMechanismProvider' => $baseDir . '/../lib/Lib/Config/IAuthMechanismProvider.php', |
|
| 74 | - 'OCA\\Files_External\\Lib\\Config\\IBackendProvider' => $baseDir . '/../lib/Lib/Config/IBackendProvider.php', |
|
| 75 | - 'OCA\\Files_External\\Lib\\DefinitionParameter' => $baseDir . '/../lib/Lib/DefinitionParameter.php', |
|
| 76 | - 'OCA\\Files_External\\Lib\\DependencyTrait' => $baseDir . '/../lib/Lib/DependencyTrait.php', |
|
| 77 | - 'OCA\\Files_External\\Lib\\FrontendDefinitionTrait' => $baseDir . '/../lib/Lib/FrontendDefinitionTrait.php', |
|
| 78 | - 'OCA\\Files_External\\Lib\\IFrontendDefinition' => $baseDir . '/../lib/Lib/IFrontendDefinition.php', |
|
| 79 | - 'OCA\\Files_External\\Lib\\IIdentifier' => $baseDir . '/../lib/Lib/IIdentifier.php', |
|
| 80 | - 'OCA\\Files_External\\Lib\\IdentifierTrait' => $baseDir . '/../lib/Lib/IdentifierTrait.php', |
|
| 81 | - 'OCA\\Files_External\\Lib\\InsufficientDataForMeaningfulAnswerException' => $baseDir . '/../lib/Lib/InsufficientDataForMeaningfulAnswerException.php', |
|
| 82 | - 'OCA\\Files_External\\Lib\\LegacyDependencyCheckPolyfill' => $baseDir . '/../lib/Lib/LegacyDependencyCheckPolyfill.php', |
|
| 83 | - 'OCA\\Files_External\\Lib\\MissingDependency' => $baseDir . '/../lib/Lib/MissingDependency.php', |
|
| 84 | - 'OCA\\Files_External\\Lib\\Notify\\SMBNotifyHandler' => $baseDir . '/../lib/Lib/Notify/SMBNotifyHandler.php', |
|
| 85 | - 'OCA\\Files_External\\Lib\\PersonalMount' => $baseDir . '/../lib/Lib/PersonalMount.php', |
|
| 86 | - 'OCA\\Files_External\\Lib\\PriorityTrait' => $baseDir . '/../lib/Lib/PriorityTrait.php', |
|
| 87 | - 'OCA\\Files_External\\Lib\\SessionStorageWrapper' => $baseDir . '/../lib/Lib/SessionStorageWrapper.php', |
|
| 88 | - 'OCA\\Files_External\\Lib\\StorageConfig' => $baseDir . '/../lib/Lib/StorageConfig.php', |
|
| 89 | - 'OCA\\Files_External\\Lib\\StorageModifierTrait' => $baseDir . '/../lib/Lib/StorageModifierTrait.php', |
|
| 90 | - 'OCA\\Files_External\\Lib\\Storage\\AmazonS3' => $baseDir . '/../lib/Lib/Storage/AmazonS3.php', |
|
| 91 | - 'OCA\\Files_External\\Lib\\Storage\\FTP' => $baseDir . '/../lib/Lib/Storage/FTP.php', |
|
| 92 | - 'OCA\\Files_External\\Lib\\Storage\\FtpConnection' => $baseDir . '/../lib/Lib/Storage/FtpConnection.php', |
|
| 93 | - 'OCA\\Files_External\\Lib\\Storage\\OwnCloud' => $baseDir . '/../lib/Lib/Storage/OwnCloud.php', |
|
| 94 | - 'OCA\\Files_External\\Lib\\Storage\\SFTP' => $baseDir . '/../lib/Lib/Storage/SFTP.php', |
|
| 95 | - 'OCA\\Files_External\\Lib\\Storage\\SFTPReadStream' => $baseDir . '/../lib/Lib/Storage/SFTPReadStream.php', |
|
| 96 | - 'OCA\\Files_External\\Lib\\Storage\\SFTPWriteStream' => $baseDir . '/../lib/Lib/Storage/SFTPWriteStream.php', |
|
| 97 | - 'OCA\\Files_External\\Lib\\Storage\\SMB' => $baseDir . '/../lib/Lib/Storage/SMB.php', |
|
| 98 | - 'OCA\\Files_External\\Lib\\Storage\\StreamWrapper' => $baseDir . '/../lib/Lib/Storage/StreamWrapper.php', |
|
| 99 | - 'OCA\\Files_External\\Lib\\Storage\\Swift' => $baseDir . '/../lib/Lib/Storage/Swift.php', |
|
| 100 | - 'OCA\\Files_External\\Lib\\Storage\\SystemBridge' => $baseDir . '/../lib/Lib/Storage/SystemBridge.php', |
|
| 101 | - 'OCA\\Files_External\\Lib\\VisibilityTrait' => $baseDir . '/../lib/Lib/VisibilityTrait.php', |
|
| 102 | - 'OCA\\Files_External\\Listener\\GroupDeletedListener' => $baseDir . '/../lib/Listener/GroupDeletedListener.php', |
|
| 103 | - 'OCA\\Files_External\\Listener\\LoadAdditionalListener' => $baseDir . '/../lib/Listener/LoadAdditionalListener.php', |
|
| 104 | - 'OCA\\Files_External\\Listener\\StorePasswordListener' => $baseDir . '/../lib/Listener/StorePasswordListener.php', |
|
| 105 | - 'OCA\\Files_External\\Listener\\UserDeletedListener' => $baseDir . '/../lib/Listener/UserDeletedListener.php', |
|
| 106 | - 'OCA\\Files_External\\Migration\\DummyUserSession' => $baseDir . '/../lib/Migration/DummyUserSession.php', |
|
| 107 | - 'OCA\\Files_External\\Migration\\Version1011Date20200630192246' => $baseDir . '/../lib/Migration/Version1011Date20200630192246.php', |
|
| 108 | - 'OCA\\Files_External\\Migration\\Version1015Date20211104103506' => $baseDir . '/../lib/Migration/Version1015Date20211104103506.php', |
|
| 109 | - 'OCA\\Files_External\\Migration\\Version1016Date20220324154536' => $baseDir . '/../lib/Migration/Version1016Date20220324154536.php', |
|
| 110 | - 'OCA\\Files_External\\Migration\\Version1025Date20250228162604' => $baseDir . '/../lib/Migration/Version1025Date20250228162604.php', |
|
| 111 | - 'OCA\\Files_External\\Migration\\Version22000Date20210216084416' => $baseDir . '/../lib/Migration/Version22000Date20210216084416.php', |
|
| 112 | - 'OCA\\Files_External\\MountConfig' => $baseDir . '/../lib/MountConfig.php', |
|
| 113 | - 'OCA\\Files_External\\NotFoundException' => $baseDir . '/../lib/NotFoundException.php', |
|
| 114 | - 'OCA\\Files_External\\ResponseDefinitions' => $baseDir . '/../lib/ResponseDefinitions.php', |
|
| 115 | - 'OCA\\Files_External\\Service\\BackendService' => $baseDir . '/../lib/Service/BackendService.php', |
|
| 116 | - 'OCA\\Files_External\\Service\\DBConfigService' => $baseDir . '/../lib/Service/DBConfigService.php', |
|
| 117 | - 'OCA\\Files_External\\Service\\GlobalStoragesService' => $baseDir . '/../lib/Service/GlobalStoragesService.php', |
|
| 118 | - 'OCA\\Files_External\\Service\\ImportLegacyStoragesService' => $baseDir . '/../lib/Service/ImportLegacyStoragesService.php', |
|
| 119 | - 'OCA\\Files_External\\Service\\LegacyStoragesService' => $baseDir . '/../lib/Service/LegacyStoragesService.php', |
|
| 120 | - 'OCA\\Files_External\\Service\\StoragesService' => $baseDir . '/../lib/Service/StoragesService.php', |
|
| 121 | - 'OCA\\Files_External\\Service\\UserGlobalStoragesService' => $baseDir . '/../lib/Service/UserGlobalStoragesService.php', |
|
| 122 | - 'OCA\\Files_External\\Service\\UserStoragesService' => $baseDir . '/../lib/Service/UserStoragesService.php', |
|
| 123 | - 'OCA\\Files_External\\Service\\UserTrait' => $baseDir . '/../lib/Service/UserTrait.php', |
|
| 124 | - 'OCA\\Files_External\\Settings\\Admin' => $baseDir . '/../lib/Settings/Admin.php', |
|
| 125 | - 'OCA\\Files_External\\Settings\\Personal' => $baseDir . '/../lib/Settings/Personal.php', |
|
| 126 | - 'OCA\\Files_External\\Settings\\PersonalSection' => $baseDir . '/../lib/Settings/PersonalSection.php', |
|
| 127 | - 'OCA\\Files_External\\Settings\\Section' => $baseDir . '/../lib/Settings/Section.php', |
|
| 9 | + 'Composer\\InstalledVersions' => $vendorDir.'/composer/InstalledVersions.php', |
|
| 10 | + 'OCA\\Files_External\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php', |
|
| 11 | + 'OCA\\Files_External\\BackgroundJob\\CredentialsCleanup' => $baseDir.'/../lib/BackgroundJob/CredentialsCleanup.php', |
|
| 12 | + 'OCA\\Files_External\\Command\\Applicable' => $baseDir.'/../lib/Command/Applicable.php', |
|
| 13 | + 'OCA\\Files_External\\Command\\Backends' => $baseDir.'/../lib/Command/Backends.php', |
|
| 14 | + 'OCA\\Files_External\\Command\\Config' => $baseDir.'/../lib/Command/Config.php', |
|
| 15 | + 'OCA\\Files_External\\Command\\Create' => $baseDir.'/../lib/Command/Create.php', |
|
| 16 | + 'OCA\\Files_External\\Command\\Delete' => $baseDir.'/../lib/Command/Delete.php', |
|
| 17 | + 'OCA\\Files_External\\Command\\Dependencies' => $baseDir.'/../lib/Command/Dependencies.php', |
|
| 18 | + 'OCA\\Files_External\\Command\\Export' => $baseDir.'/../lib/Command/Export.php', |
|
| 19 | + 'OCA\\Files_External\\Command\\Import' => $baseDir.'/../lib/Command/Import.php', |
|
| 20 | + 'OCA\\Files_External\\Command\\ListCommand' => $baseDir.'/../lib/Command/ListCommand.php', |
|
| 21 | + 'OCA\\Files_External\\Command\\Notify' => $baseDir.'/../lib/Command/Notify.php', |
|
| 22 | + 'OCA\\Files_External\\Command\\Option' => $baseDir.'/../lib/Command/Option.php', |
|
| 23 | + 'OCA\\Files_External\\Command\\Scan' => $baseDir.'/../lib/Command/Scan.php', |
|
| 24 | + 'OCA\\Files_External\\Command\\StorageAuthBase' => $baseDir.'/../lib/Command/StorageAuthBase.php', |
|
| 25 | + 'OCA\\Files_External\\Command\\Verify' => $baseDir.'/../lib/Command/Verify.php', |
|
| 26 | + 'OCA\\Files_External\\ConfigLexicon' => $baseDir.'/../lib/ConfigLexicon.php', |
|
| 27 | + 'OCA\\Files_External\\Config\\ConfigAdapter' => $baseDir.'/../lib/Config/ConfigAdapter.php', |
|
| 28 | + 'OCA\\Files_External\\Config\\ExternalMountPoint' => $baseDir.'/../lib/Config/ExternalMountPoint.php', |
|
| 29 | + 'OCA\\Files_External\\Config\\IConfigHandler' => $baseDir.'/../lib/Config/IConfigHandler.php', |
|
| 30 | + 'OCA\\Files_External\\Config\\SimpleSubstitutionTrait' => $baseDir.'/../lib/Config/SimpleSubstitutionTrait.php', |
|
| 31 | + 'OCA\\Files_External\\Config\\SystemMountPoint' => $baseDir.'/../lib/Config/SystemMountPoint.php', |
|
| 32 | + 'OCA\\Files_External\\Config\\UserContext' => $baseDir.'/../lib/Config/UserContext.php', |
|
| 33 | + 'OCA\\Files_External\\Config\\UserPlaceholderHandler' => $baseDir.'/../lib/Config/UserPlaceholderHandler.php', |
|
| 34 | + 'OCA\\Files_External\\Controller\\AjaxController' => $baseDir.'/../lib/Controller/AjaxController.php', |
|
| 35 | + 'OCA\\Files_External\\Controller\\ApiController' => $baseDir.'/../lib/Controller/ApiController.php', |
|
| 36 | + 'OCA\\Files_External\\Controller\\GlobalStoragesController' => $baseDir.'/../lib/Controller/GlobalStoragesController.php', |
|
| 37 | + 'OCA\\Files_External\\Controller\\StoragesController' => $baseDir.'/../lib/Controller/StoragesController.php', |
|
| 38 | + 'OCA\\Files_External\\Controller\\UserGlobalStoragesController' => $baseDir.'/../lib/Controller/UserGlobalStoragesController.php', |
|
| 39 | + 'OCA\\Files_External\\Controller\\UserStoragesController' => $baseDir.'/../lib/Controller/UserStoragesController.php', |
|
| 40 | + 'OCA\\Files_External\\Lib\\Auth\\AmazonS3\\AccessKey' => $baseDir.'/../lib/Lib/Auth/AmazonS3/AccessKey.php', |
|
| 41 | + 'OCA\\Files_External\\Lib\\Auth\\AuthMechanism' => $baseDir.'/../lib/Lib/Auth/AuthMechanism.php', |
|
| 42 | + 'OCA\\Files_External\\Lib\\Auth\\Builtin' => $baseDir.'/../lib/Lib/Auth/Builtin.php', |
|
| 43 | + 'OCA\\Files_External\\Lib\\Auth\\IUserProvided' => $baseDir.'/../lib/Lib/Auth/IUserProvided.php', |
|
| 44 | + 'OCA\\Files_External\\Lib\\Auth\\InvalidAuth' => $baseDir.'/../lib/Lib/Auth/InvalidAuth.php', |
|
| 45 | + 'OCA\\Files_External\\Lib\\Auth\\NullMechanism' => $baseDir.'/../lib/Lib/Auth/NullMechanism.php', |
|
| 46 | + 'OCA\\Files_External\\Lib\\Auth\\OAuth2\\OAuth2' => $baseDir.'/../lib/Lib/Auth/OAuth2/OAuth2.php', |
|
| 47 | + 'OCA\\Files_External\\Lib\\Auth\\OpenStack\\OpenStackV2' => $baseDir.'/../lib/Lib/Auth/OpenStack/OpenStackV2.php', |
|
| 48 | + 'OCA\\Files_External\\Lib\\Auth\\OpenStack\\OpenStackV3' => $baseDir.'/../lib/Lib/Auth/OpenStack/OpenStackV3.php', |
|
| 49 | + 'OCA\\Files_External\\Lib\\Auth\\OpenStack\\Rackspace' => $baseDir.'/../lib/Lib/Auth/OpenStack/Rackspace.php', |
|
| 50 | + 'OCA\\Files_External\\Lib\\Auth\\Password\\GlobalAuth' => $baseDir.'/../lib/Lib/Auth/Password/GlobalAuth.php', |
|
| 51 | + 'OCA\\Files_External\\Lib\\Auth\\Password\\LoginCredentials' => $baseDir.'/../lib/Lib/Auth/Password/LoginCredentials.php', |
|
| 52 | + 'OCA\\Files_External\\Lib\\Auth\\Password\\Password' => $baseDir.'/../lib/Lib/Auth/Password/Password.php', |
|
| 53 | + 'OCA\\Files_External\\Lib\\Auth\\Password\\SessionCredentials' => $baseDir.'/../lib/Lib/Auth/Password/SessionCredentials.php', |
|
| 54 | + 'OCA\\Files_External\\Lib\\Auth\\Password\\UserGlobalAuth' => $baseDir.'/../lib/Lib/Auth/Password/UserGlobalAuth.php', |
|
| 55 | + 'OCA\\Files_External\\Lib\\Auth\\Password\\UserProvided' => $baseDir.'/../lib/Lib/Auth/Password/UserProvided.php', |
|
| 56 | + 'OCA\\Files_External\\Lib\\Auth\\PublicKey\\RSA' => $baseDir.'/../lib/Lib/Auth/PublicKey/RSA.php', |
|
| 57 | + 'OCA\\Files_External\\Lib\\Auth\\PublicKey\\RSAPrivateKey' => $baseDir.'/../lib/Lib/Auth/PublicKey/RSAPrivateKey.php', |
|
| 58 | + 'OCA\\Files_External\\Lib\\Auth\\SMB\\KerberosApacheAuth' => $baseDir.'/../lib/Lib/Auth/SMB/KerberosApacheAuth.php', |
|
| 59 | + 'OCA\\Files_External\\Lib\\Auth\\SMB\\KerberosAuth' => $baseDir.'/../lib/Lib/Auth/SMB/KerberosAuth.php', |
|
| 60 | + 'OCA\\Files_External\\Lib\\Backend\\AmazonS3' => $baseDir.'/../lib/Lib/Backend/AmazonS3.php', |
|
| 61 | + 'OCA\\Files_External\\Lib\\Backend\\Backend' => $baseDir.'/../lib/Lib/Backend/Backend.php', |
|
| 62 | + 'OCA\\Files_External\\Lib\\Backend\\DAV' => $baseDir.'/../lib/Lib/Backend/DAV.php', |
|
| 63 | + 'OCA\\Files_External\\Lib\\Backend\\FTP' => $baseDir.'/../lib/Lib/Backend/FTP.php', |
|
| 64 | + 'OCA\\Files_External\\Lib\\Backend\\InvalidBackend' => $baseDir.'/../lib/Lib/Backend/InvalidBackend.php', |
|
| 65 | + 'OCA\\Files_External\\Lib\\Backend\\LegacyBackend' => $baseDir.'/../lib/Lib/Backend/LegacyBackend.php', |
|
| 66 | + 'OCA\\Files_External\\Lib\\Backend\\Local' => $baseDir.'/../lib/Lib/Backend/Local.php', |
|
| 67 | + 'OCA\\Files_External\\Lib\\Backend\\OwnCloud' => $baseDir.'/../lib/Lib/Backend/OwnCloud.php', |
|
| 68 | + 'OCA\\Files_External\\Lib\\Backend\\SFTP' => $baseDir.'/../lib/Lib/Backend/SFTP.php', |
|
| 69 | + 'OCA\\Files_External\\Lib\\Backend\\SFTP_Key' => $baseDir.'/../lib/Lib/Backend/SFTP_Key.php', |
|
| 70 | + 'OCA\\Files_External\\Lib\\Backend\\SMB' => $baseDir.'/../lib/Lib/Backend/SMB.php', |
|
| 71 | + 'OCA\\Files_External\\Lib\\Backend\\SMB_OC' => $baseDir.'/../lib/Lib/Backend/SMB_OC.php', |
|
| 72 | + 'OCA\\Files_External\\Lib\\Backend\\Swift' => $baseDir.'/../lib/Lib/Backend/Swift.php', |
|
| 73 | + 'OCA\\Files_External\\Lib\\Config\\IAuthMechanismProvider' => $baseDir.'/../lib/Lib/Config/IAuthMechanismProvider.php', |
|
| 74 | + 'OCA\\Files_External\\Lib\\Config\\IBackendProvider' => $baseDir.'/../lib/Lib/Config/IBackendProvider.php', |
|
| 75 | + 'OCA\\Files_External\\Lib\\DefinitionParameter' => $baseDir.'/../lib/Lib/DefinitionParameter.php', |
|
| 76 | + 'OCA\\Files_External\\Lib\\DependencyTrait' => $baseDir.'/../lib/Lib/DependencyTrait.php', |
|
| 77 | + 'OCA\\Files_External\\Lib\\FrontendDefinitionTrait' => $baseDir.'/../lib/Lib/FrontendDefinitionTrait.php', |
|
| 78 | + 'OCA\\Files_External\\Lib\\IFrontendDefinition' => $baseDir.'/../lib/Lib/IFrontendDefinition.php', |
|
| 79 | + 'OCA\\Files_External\\Lib\\IIdentifier' => $baseDir.'/../lib/Lib/IIdentifier.php', |
|
| 80 | + 'OCA\\Files_External\\Lib\\IdentifierTrait' => $baseDir.'/../lib/Lib/IdentifierTrait.php', |
|
| 81 | + 'OCA\\Files_External\\Lib\\InsufficientDataForMeaningfulAnswerException' => $baseDir.'/../lib/Lib/InsufficientDataForMeaningfulAnswerException.php', |
|
| 82 | + 'OCA\\Files_External\\Lib\\LegacyDependencyCheckPolyfill' => $baseDir.'/../lib/Lib/LegacyDependencyCheckPolyfill.php', |
|
| 83 | + 'OCA\\Files_External\\Lib\\MissingDependency' => $baseDir.'/../lib/Lib/MissingDependency.php', |
|
| 84 | + 'OCA\\Files_External\\Lib\\Notify\\SMBNotifyHandler' => $baseDir.'/../lib/Lib/Notify/SMBNotifyHandler.php', |
|
| 85 | + 'OCA\\Files_External\\Lib\\PersonalMount' => $baseDir.'/../lib/Lib/PersonalMount.php', |
|
| 86 | + 'OCA\\Files_External\\Lib\\PriorityTrait' => $baseDir.'/../lib/Lib/PriorityTrait.php', |
|
| 87 | + 'OCA\\Files_External\\Lib\\SessionStorageWrapper' => $baseDir.'/../lib/Lib/SessionStorageWrapper.php', |
|
| 88 | + 'OCA\\Files_External\\Lib\\StorageConfig' => $baseDir.'/../lib/Lib/StorageConfig.php', |
|
| 89 | + 'OCA\\Files_External\\Lib\\StorageModifierTrait' => $baseDir.'/../lib/Lib/StorageModifierTrait.php', |
|
| 90 | + 'OCA\\Files_External\\Lib\\Storage\\AmazonS3' => $baseDir.'/../lib/Lib/Storage/AmazonS3.php', |
|
| 91 | + 'OCA\\Files_External\\Lib\\Storage\\FTP' => $baseDir.'/../lib/Lib/Storage/FTP.php', |
|
| 92 | + 'OCA\\Files_External\\Lib\\Storage\\FtpConnection' => $baseDir.'/../lib/Lib/Storage/FtpConnection.php', |
|
| 93 | + 'OCA\\Files_External\\Lib\\Storage\\OwnCloud' => $baseDir.'/../lib/Lib/Storage/OwnCloud.php', |
|
| 94 | + 'OCA\\Files_External\\Lib\\Storage\\SFTP' => $baseDir.'/../lib/Lib/Storage/SFTP.php', |
|
| 95 | + 'OCA\\Files_External\\Lib\\Storage\\SFTPReadStream' => $baseDir.'/../lib/Lib/Storage/SFTPReadStream.php', |
|
| 96 | + 'OCA\\Files_External\\Lib\\Storage\\SFTPWriteStream' => $baseDir.'/../lib/Lib/Storage/SFTPWriteStream.php', |
|
| 97 | + 'OCA\\Files_External\\Lib\\Storage\\SMB' => $baseDir.'/../lib/Lib/Storage/SMB.php', |
|
| 98 | + 'OCA\\Files_External\\Lib\\Storage\\StreamWrapper' => $baseDir.'/../lib/Lib/Storage/StreamWrapper.php', |
|
| 99 | + 'OCA\\Files_External\\Lib\\Storage\\Swift' => $baseDir.'/../lib/Lib/Storage/Swift.php', |
|
| 100 | + 'OCA\\Files_External\\Lib\\Storage\\SystemBridge' => $baseDir.'/../lib/Lib/Storage/SystemBridge.php', |
|
| 101 | + 'OCA\\Files_External\\Lib\\VisibilityTrait' => $baseDir.'/../lib/Lib/VisibilityTrait.php', |
|
| 102 | + 'OCA\\Files_External\\Listener\\GroupDeletedListener' => $baseDir.'/../lib/Listener/GroupDeletedListener.php', |
|
| 103 | + 'OCA\\Files_External\\Listener\\LoadAdditionalListener' => $baseDir.'/../lib/Listener/LoadAdditionalListener.php', |
|
| 104 | + 'OCA\\Files_External\\Listener\\StorePasswordListener' => $baseDir.'/../lib/Listener/StorePasswordListener.php', |
|
| 105 | + 'OCA\\Files_External\\Listener\\UserDeletedListener' => $baseDir.'/../lib/Listener/UserDeletedListener.php', |
|
| 106 | + 'OCA\\Files_External\\Migration\\DummyUserSession' => $baseDir.'/../lib/Migration/DummyUserSession.php', |
|
| 107 | + 'OCA\\Files_External\\Migration\\Version1011Date20200630192246' => $baseDir.'/../lib/Migration/Version1011Date20200630192246.php', |
|
| 108 | + 'OCA\\Files_External\\Migration\\Version1015Date20211104103506' => $baseDir.'/../lib/Migration/Version1015Date20211104103506.php', |
|
| 109 | + 'OCA\\Files_External\\Migration\\Version1016Date20220324154536' => $baseDir.'/../lib/Migration/Version1016Date20220324154536.php', |
|
| 110 | + 'OCA\\Files_External\\Migration\\Version1025Date20250228162604' => $baseDir.'/../lib/Migration/Version1025Date20250228162604.php', |
|
| 111 | + 'OCA\\Files_External\\Migration\\Version22000Date20210216084416' => $baseDir.'/../lib/Migration/Version22000Date20210216084416.php', |
|
| 112 | + 'OCA\\Files_External\\MountConfig' => $baseDir.'/../lib/MountConfig.php', |
|
| 113 | + 'OCA\\Files_External\\NotFoundException' => $baseDir.'/../lib/NotFoundException.php', |
|
| 114 | + 'OCA\\Files_External\\ResponseDefinitions' => $baseDir.'/../lib/ResponseDefinitions.php', |
|
| 115 | + 'OCA\\Files_External\\Service\\BackendService' => $baseDir.'/../lib/Service/BackendService.php', |
|
| 116 | + 'OCA\\Files_External\\Service\\DBConfigService' => $baseDir.'/../lib/Service/DBConfigService.php', |
|
| 117 | + 'OCA\\Files_External\\Service\\GlobalStoragesService' => $baseDir.'/../lib/Service/GlobalStoragesService.php', |
|
| 118 | + 'OCA\\Files_External\\Service\\ImportLegacyStoragesService' => $baseDir.'/../lib/Service/ImportLegacyStoragesService.php', |
|
| 119 | + 'OCA\\Files_External\\Service\\LegacyStoragesService' => $baseDir.'/../lib/Service/LegacyStoragesService.php', |
|
| 120 | + 'OCA\\Files_External\\Service\\StoragesService' => $baseDir.'/../lib/Service/StoragesService.php', |
|
| 121 | + 'OCA\\Files_External\\Service\\UserGlobalStoragesService' => $baseDir.'/../lib/Service/UserGlobalStoragesService.php', |
|
| 122 | + 'OCA\\Files_External\\Service\\UserStoragesService' => $baseDir.'/../lib/Service/UserStoragesService.php', |
|
| 123 | + 'OCA\\Files_External\\Service\\UserTrait' => $baseDir.'/../lib/Service/UserTrait.php', |
|
| 124 | + 'OCA\\Files_External\\Settings\\Admin' => $baseDir.'/../lib/Settings/Admin.php', |
|
| 125 | + 'OCA\\Files_External\\Settings\\Personal' => $baseDir.'/../lib/Settings/Personal.php', |
|
| 126 | + 'OCA\\Files_External\\Settings\\PersonalSection' => $baseDir.'/../lib/Settings/PersonalSection.php', |
|
| 127 | + 'OCA\\Files_External\\Settings\\Section' => $baseDir.'/../lib/Settings/Section.php', |
|
| 128 | 128 | ); |
@@ -6,145 +6,145 @@ |
||
| 6 | 6 | |
| 7 | 7 | class ComposerStaticInitFiles_External |
| 8 | 8 | { |
| 9 | - public static $prefixLengthsPsr4 = array ( |
|
| 9 | + public static $prefixLengthsPsr4 = array( |
|
| 10 | 10 | 'O' => |
| 11 | - array ( |
|
| 11 | + array( |
|
| 12 | 12 | 'OCA\\Files_External\\' => 19, |
| 13 | 13 | ), |
| 14 | 14 | ); |
| 15 | 15 | |
| 16 | - public static $prefixDirsPsr4 = array ( |
|
| 16 | + public static $prefixDirsPsr4 = array( |
|
| 17 | 17 | 'OCA\\Files_External\\' => |
| 18 | - array ( |
|
| 19 | - 0 => __DIR__ . '/..' . '/../lib', |
|
| 18 | + array( |
|
| 19 | + 0 => __DIR__.'/..'.'/../lib', |
|
| 20 | 20 | ), |
| 21 | 21 | ); |
| 22 | 22 | |
| 23 | - public static $classMap = array ( |
|
| 24 | - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', |
|
| 25 | - 'OCA\\Files_External\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php', |
|
| 26 | - 'OCA\\Files_External\\BackgroundJob\\CredentialsCleanup' => __DIR__ . '/..' . '/../lib/BackgroundJob/CredentialsCleanup.php', |
|
| 27 | - 'OCA\\Files_External\\Command\\Applicable' => __DIR__ . '/..' . '/../lib/Command/Applicable.php', |
|
| 28 | - 'OCA\\Files_External\\Command\\Backends' => __DIR__ . '/..' . '/../lib/Command/Backends.php', |
|
| 29 | - 'OCA\\Files_External\\Command\\Config' => __DIR__ . '/..' . '/../lib/Command/Config.php', |
|
| 30 | - 'OCA\\Files_External\\Command\\Create' => __DIR__ . '/..' . '/../lib/Command/Create.php', |
|
| 31 | - 'OCA\\Files_External\\Command\\Delete' => __DIR__ . '/..' . '/../lib/Command/Delete.php', |
|
| 32 | - 'OCA\\Files_External\\Command\\Dependencies' => __DIR__ . '/..' . '/../lib/Command/Dependencies.php', |
|
| 33 | - 'OCA\\Files_External\\Command\\Export' => __DIR__ . '/..' . '/../lib/Command/Export.php', |
|
| 34 | - 'OCA\\Files_External\\Command\\Import' => __DIR__ . '/..' . '/../lib/Command/Import.php', |
|
| 35 | - 'OCA\\Files_External\\Command\\ListCommand' => __DIR__ . '/..' . '/../lib/Command/ListCommand.php', |
|
| 36 | - 'OCA\\Files_External\\Command\\Notify' => __DIR__ . '/..' . '/../lib/Command/Notify.php', |
|
| 37 | - 'OCA\\Files_External\\Command\\Option' => __DIR__ . '/..' . '/../lib/Command/Option.php', |
|
| 38 | - 'OCA\\Files_External\\Command\\Scan' => __DIR__ . '/..' . '/../lib/Command/Scan.php', |
|
| 39 | - 'OCA\\Files_External\\Command\\StorageAuthBase' => __DIR__ . '/..' . '/../lib/Command/StorageAuthBase.php', |
|
| 40 | - 'OCA\\Files_External\\Command\\Verify' => __DIR__ . '/..' . '/../lib/Command/Verify.php', |
|
| 41 | - 'OCA\\Files_External\\ConfigLexicon' => __DIR__ . '/..' . '/../lib/ConfigLexicon.php', |
|
| 42 | - 'OCA\\Files_External\\Config\\ConfigAdapter' => __DIR__ . '/..' . '/../lib/Config/ConfigAdapter.php', |
|
| 43 | - 'OCA\\Files_External\\Config\\ExternalMountPoint' => __DIR__ . '/..' . '/../lib/Config/ExternalMountPoint.php', |
|
| 44 | - 'OCA\\Files_External\\Config\\IConfigHandler' => __DIR__ . '/..' . '/../lib/Config/IConfigHandler.php', |
|
| 45 | - 'OCA\\Files_External\\Config\\SimpleSubstitutionTrait' => __DIR__ . '/..' . '/../lib/Config/SimpleSubstitutionTrait.php', |
|
| 46 | - 'OCA\\Files_External\\Config\\SystemMountPoint' => __DIR__ . '/..' . '/../lib/Config/SystemMountPoint.php', |
|
| 47 | - 'OCA\\Files_External\\Config\\UserContext' => __DIR__ . '/..' . '/../lib/Config/UserContext.php', |
|
| 48 | - 'OCA\\Files_External\\Config\\UserPlaceholderHandler' => __DIR__ . '/..' . '/../lib/Config/UserPlaceholderHandler.php', |
|
| 49 | - 'OCA\\Files_External\\Controller\\AjaxController' => __DIR__ . '/..' . '/../lib/Controller/AjaxController.php', |
|
| 50 | - 'OCA\\Files_External\\Controller\\ApiController' => __DIR__ . '/..' . '/../lib/Controller/ApiController.php', |
|
| 51 | - 'OCA\\Files_External\\Controller\\GlobalStoragesController' => __DIR__ . '/..' . '/../lib/Controller/GlobalStoragesController.php', |
|
| 52 | - 'OCA\\Files_External\\Controller\\StoragesController' => __DIR__ . '/..' . '/../lib/Controller/StoragesController.php', |
|
| 53 | - 'OCA\\Files_External\\Controller\\UserGlobalStoragesController' => __DIR__ . '/..' . '/../lib/Controller/UserGlobalStoragesController.php', |
|
| 54 | - 'OCA\\Files_External\\Controller\\UserStoragesController' => __DIR__ . '/..' . '/../lib/Controller/UserStoragesController.php', |
|
| 55 | - 'OCA\\Files_External\\Lib\\Auth\\AmazonS3\\AccessKey' => __DIR__ . '/..' . '/../lib/Lib/Auth/AmazonS3/AccessKey.php', |
|
| 56 | - 'OCA\\Files_External\\Lib\\Auth\\AuthMechanism' => __DIR__ . '/..' . '/../lib/Lib/Auth/AuthMechanism.php', |
|
| 57 | - 'OCA\\Files_External\\Lib\\Auth\\Builtin' => __DIR__ . '/..' . '/../lib/Lib/Auth/Builtin.php', |
|
| 58 | - 'OCA\\Files_External\\Lib\\Auth\\IUserProvided' => __DIR__ . '/..' . '/../lib/Lib/Auth/IUserProvided.php', |
|
| 59 | - 'OCA\\Files_External\\Lib\\Auth\\InvalidAuth' => __DIR__ . '/..' . '/../lib/Lib/Auth/InvalidAuth.php', |
|
| 60 | - 'OCA\\Files_External\\Lib\\Auth\\NullMechanism' => __DIR__ . '/..' . '/../lib/Lib/Auth/NullMechanism.php', |
|
| 61 | - 'OCA\\Files_External\\Lib\\Auth\\OAuth2\\OAuth2' => __DIR__ . '/..' . '/../lib/Lib/Auth/OAuth2/OAuth2.php', |
|
| 62 | - 'OCA\\Files_External\\Lib\\Auth\\OpenStack\\OpenStackV2' => __DIR__ . '/..' . '/../lib/Lib/Auth/OpenStack/OpenStackV2.php', |
|
| 63 | - 'OCA\\Files_External\\Lib\\Auth\\OpenStack\\OpenStackV3' => __DIR__ . '/..' . '/../lib/Lib/Auth/OpenStack/OpenStackV3.php', |
|
| 64 | - 'OCA\\Files_External\\Lib\\Auth\\OpenStack\\Rackspace' => __DIR__ . '/..' . '/../lib/Lib/Auth/OpenStack/Rackspace.php', |
|
| 65 | - 'OCA\\Files_External\\Lib\\Auth\\Password\\GlobalAuth' => __DIR__ . '/..' . '/../lib/Lib/Auth/Password/GlobalAuth.php', |
|
| 66 | - 'OCA\\Files_External\\Lib\\Auth\\Password\\LoginCredentials' => __DIR__ . '/..' . '/../lib/Lib/Auth/Password/LoginCredentials.php', |
|
| 67 | - 'OCA\\Files_External\\Lib\\Auth\\Password\\Password' => __DIR__ . '/..' . '/../lib/Lib/Auth/Password/Password.php', |
|
| 68 | - 'OCA\\Files_External\\Lib\\Auth\\Password\\SessionCredentials' => __DIR__ . '/..' . '/../lib/Lib/Auth/Password/SessionCredentials.php', |
|
| 69 | - 'OCA\\Files_External\\Lib\\Auth\\Password\\UserGlobalAuth' => __DIR__ . '/..' . '/../lib/Lib/Auth/Password/UserGlobalAuth.php', |
|
| 70 | - 'OCA\\Files_External\\Lib\\Auth\\Password\\UserProvided' => __DIR__ . '/..' . '/../lib/Lib/Auth/Password/UserProvided.php', |
|
| 71 | - 'OCA\\Files_External\\Lib\\Auth\\PublicKey\\RSA' => __DIR__ . '/..' . '/../lib/Lib/Auth/PublicKey/RSA.php', |
|
| 72 | - 'OCA\\Files_External\\Lib\\Auth\\PublicKey\\RSAPrivateKey' => __DIR__ . '/..' . '/../lib/Lib/Auth/PublicKey/RSAPrivateKey.php', |
|
| 73 | - 'OCA\\Files_External\\Lib\\Auth\\SMB\\KerberosApacheAuth' => __DIR__ . '/..' . '/../lib/Lib/Auth/SMB/KerberosApacheAuth.php', |
|
| 74 | - 'OCA\\Files_External\\Lib\\Auth\\SMB\\KerberosAuth' => __DIR__ . '/..' . '/../lib/Lib/Auth/SMB/KerberosAuth.php', |
|
| 75 | - 'OCA\\Files_External\\Lib\\Backend\\AmazonS3' => __DIR__ . '/..' . '/../lib/Lib/Backend/AmazonS3.php', |
|
| 76 | - 'OCA\\Files_External\\Lib\\Backend\\Backend' => __DIR__ . '/..' . '/../lib/Lib/Backend/Backend.php', |
|
| 77 | - 'OCA\\Files_External\\Lib\\Backend\\DAV' => __DIR__ . '/..' . '/../lib/Lib/Backend/DAV.php', |
|
| 78 | - 'OCA\\Files_External\\Lib\\Backend\\FTP' => __DIR__ . '/..' . '/../lib/Lib/Backend/FTP.php', |
|
| 79 | - 'OCA\\Files_External\\Lib\\Backend\\InvalidBackend' => __DIR__ . '/..' . '/../lib/Lib/Backend/InvalidBackend.php', |
|
| 80 | - 'OCA\\Files_External\\Lib\\Backend\\LegacyBackend' => __DIR__ . '/..' . '/../lib/Lib/Backend/LegacyBackend.php', |
|
| 81 | - 'OCA\\Files_External\\Lib\\Backend\\Local' => __DIR__ . '/..' . '/../lib/Lib/Backend/Local.php', |
|
| 82 | - 'OCA\\Files_External\\Lib\\Backend\\OwnCloud' => __DIR__ . '/..' . '/../lib/Lib/Backend/OwnCloud.php', |
|
| 83 | - 'OCA\\Files_External\\Lib\\Backend\\SFTP' => __DIR__ . '/..' . '/../lib/Lib/Backend/SFTP.php', |
|
| 84 | - 'OCA\\Files_External\\Lib\\Backend\\SFTP_Key' => __DIR__ . '/..' . '/../lib/Lib/Backend/SFTP_Key.php', |
|
| 85 | - 'OCA\\Files_External\\Lib\\Backend\\SMB' => __DIR__ . '/..' . '/../lib/Lib/Backend/SMB.php', |
|
| 86 | - 'OCA\\Files_External\\Lib\\Backend\\SMB_OC' => __DIR__ . '/..' . '/../lib/Lib/Backend/SMB_OC.php', |
|
| 87 | - 'OCA\\Files_External\\Lib\\Backend\\Swift' => __DIR__ . '/..' . '/../lib/Lib/Backend/Swift.php', |
|
| 88 | - 'OCA\\Files_External\\Lib\\Config\\IAuthMechanismProvider' => __DIR__ . '/..' . '/../lib/Lib/Config/IAuthMechanismProvider.php', |
|
| 89 | - 'OCA\\Files_External\\Lib\\Config\\IBackendProvider' => __DIR__ . '/..' . '/../lib/Lib/Config/IBackendProvider.php', |
|
| 90 | - 'OCA\\Files_External\\Lib\\DefinitionParameter' => __DIR__ . '/..' . '/../lib/Lib/DefinitionParameter.php', |
|
| 91 | - 'OCA\\Files_External\\Lib\\DependencyTrait' => __DIR__ . '/..' . '/../lib/Lib/DependencyTrait.php', |
|
| 92 | - 'OCA\\Files_External\\Lib\\FrontendDefinitionTrait' => __DIR__ . '/..' . '/../lib/Lib/FrontendDefinitionTrait.php', |
|
| 93 | - 'OCA\\Files_External\\Lib\\IFrontendDefinition' => __DIR__ . '/..' . '/../lib/Lib/IFrontendDefinition.php', |
|
| 94 | - 'OCA\\Files_External\\Lib\\IIdentifier' => __DIR__ . '/..' . '/../lib/Lib/IIdentifier.php', |
|
| 95 | - 'OCA\\Files_External\\Lib\\IdentifierTrait' => __DIR__ . '/..' . '/../lib/Lib/IdentifierTrait.php', |
|
| 96 | - 'OCA\\Files_External\\Lib\\InsufficientDataForMeaningfulAnswerException' => __DIR__ . '/..' . '/../lib/Lib/InsufficientDataForMeaningfulAnswerException.php', |
|
| 97 | - 'OCA\\Files_External\\Lib\\LegacyDependencyCheckPolyfill' => __DIR__ . '/..' . '/../lib/Lib/LegacyDependencyCheckPolyfill.php', |
|
| 98 | - 'OCA\\Files_External\\Lib\\MissingDependency' => __DIR__ . '/..' . '/../lib/Lib/MissingDependency.php', |
|
| 99 | - 'OCA\\Files_External\\Lib\\Notify\\SMBNotifyHandler' => __DIR__ . '/..' . '/../lib/Lib/Notify/SMBNotifyHandler.php', |
|
| 100 | - 'OCA\\Files_External\\Lib\\PersonalMount' => __DIR__ . '/..' . '/../lib/Lib/PersonalMount.php', |
|
| 101 | - 'OCA\\Files_External\\Lib\\PriorityTrait' => __DIR__ . '/..' . '/../lib/Lib/PriorityTrait.php', |
|
| 102 | - 'OCA\\Files_External\\Lib\\SessionStorageWrapper' => __DIR__ . '/..' . '/../lib/Lib/SessionStorageWrapper.php', |
|
| 103 | - 'OCA\\Files_External\\Lib\\StorageConfig' => __DIR__ . '/..' . '/../lib/Lib/StorageConfig.php', |
|
| 104 | - 'OCA\\Files_External\\Lib\\StorageModifierTrait' => __DIR__ . '/..' . '/../lib/Lib/StorageModifierTrait.php', |
|
| 105 | - 'OCA\\Files_External\\Lib\\Storage\\AmazonS3' => __DIR__ . '/..' . '/../lib/Lib/Storage/AmazonS3.php', |
|
| 106 | - 'OCA\\Files_External\\Lib\\Storage\\FTP' => __DIR__ . '/..' . '/../lib/Lib/Storage/FTP.php', |
|
| 107 | - 'OCA\\Files_External\\Lib\\Storage\\FtpConnection' => __DIR__ . '/..' . '/../lib/Lib/Storage/FtpConnection.php', |
|
| 108 | - 'OCA\\Files_External\\Lib\\Storage\\OwnCloud' => __DIR__ . '/..' . '/../lib/Lib/Storage/OwnCloud.php', |
|
| 109 | - 'OCA\\Files_External\\Lib\\Storage\\SFTP' => __DIR__ . '/..' . '/../lib/Lib/Storage/SFTP.php', |
|
| 110 | - 'OCA\\Files_External\\Lib\\Storage\\SFTPReadStream' => __DIR__ . '/..' . '/../lib/Lib/Storage/SFTPReadStream.php', |
|
| 111 | - 'OCA\\Files_External\\Lib\\Storage\\SFTPWriteStream' => __DIR__ . '/..' . '/../lib/Lib/Storage/SFTPWriteStream.php', |
|
| 112 | - 'OCA\\Files_External\\Lib\\Storage\\SMB' => __DIR__ . '/..' . '/../lib/Lib/Storage/SMB.php', |
|
| 113 | - 'OCA\\Files_External\\Lib\\Storage\\StreamWrapper' => __DIR__ . '/..' . '/../lib/Lib/Storage/StreamWrapper.php', |
|
| 114 | - 'OCA\\Files_External\\Lib\\Storage\\Swift' => __DIR__ . '/..' . '/../lib/Lib/Storage/Swift.php', |
|
| 115 | - 'OCA\\Files_External\\Lib\\Storage\\SystemBridge' => __DIR__ . '/..' . '/../lib/Lib/Storage/SystemBridge.php', |
|
| 116 | - 'OCA\\Files_External\\Lib\\VisibilityTrait' => __DIR__ . '/..' . '/../lib/Lib/VisibilityTrait.php', |
|
| 117 | - 'OCA\\Files_External\\Listener\\GroupDeletedListener' => __DIR__ . '/..' . '/../lib/Listener/GroupDeletedListener.php', |
|
| 118 | - 'OCA\\Files_External\\Listener\\LoadAdditionalListener' => __DIR__ . '/..' . '/../lib/Listener/LoadAdditionalListener.php', |
|
| 119 | - 'OCA\\Files_External\\Listener\\StorePasswordListener' => __DIR__ . '/..' . '/../lib/Listener/StorePasswordListener.php', |
|
| 120 | - 'OCA\\Files_External\\Listener\\UserDeletedListener' => __DIR__ . '/..' . '/../lib/Listener/UserDeletedListener.php', |
|
| 121 | - 'OCA\\Files_External\\Migration\\DummyUserSession' => __DIR__ . '/..' . '/../lib/Migration/DummyUserSession.php', |
|
| 122 | - 'OCA\\Files_External\\Migration\\Version1011Date20200630192246' => __DIR__ . '/..' . '/../lib/Migration/Version1011Date20200630192246.php', |
|
| 123 | - 'OCA\\Files_External\\Migration\\Version1015Date20211104103506' => __DIR__ . '/..' . '/../lib/Migration/Version1015Date20211104103506.php', |
|
| 124 | - 'OCA\\Files_External\\Migration\\Version1016Date20220324154536' => __DIR__ . '/..' . '/../lib/Migration/Version1016Date20220324154536.php', |
|
| 125 | - 'OCA\\Files_External\\Migration\\Version1025Date20250228162604' => __DIR__ . '/..' . '/../lib/Migration/Version1025Date20250228162604.php', |
|
| 126 | - 'OCA\\Files_External\\Migration\\Version22000Date20210216084416' => __DIR__ . '/..' . '/../lib/Migration/Version22000Date20210216084416.php', |
|
| 127 | - 'OCA\\Files_External\\MountConfig' => __DIR__ . '/..' . '/../lib/MountConfig.php', |
|
| 128 | - 'OCA\\Files_External\\NotFoundException' => __DIR__ . '/..' . '/../lib/NotFoundException.php', |
|
| 129 | - 'OCA\\Files_External\\ResponseDefinitions' => __DIR__ . '/..' . '/../lib/ResponseDefinitions.php', |
|
| 130 | - 'OCA\\Files_External\\Service\\BackendService' => __DIR__ . '/..' . '/../lib/Service/BackendService.php', |
|
| 131 | - 'OCA\\Files_External\\Service\\DBConfigService' => __DIR__ . '/..' . '/../lib/Service/DBConfigService.php', |
|
| 132 | - 'OCA\\Files_External\\Service\\GlobalStoragesService' => __DIR__ . '/..' . '/../lib/Service/GlobalStoragesService.php', |
|
| 133 | - 'OCA\\Files_External\\Service\\ImportLegacyStoragesService' => __DIR__ . '/..' . '/../lib/Service/ImportLegacyStoragesService.php', |
|
| 134 | - 'OCA\\Files_External\\Service\\LegacyStoragesService' => __DIR__ . '/..' . '/../lib/Service/LegacyStoragesService.php', |
|
| 135 | - 'OCA\\Files_External\\Service\\StoragesService' => __DIR__ . '/..' . '/../lib/Service/StoragesService.php', |
|
| 136 | - 'OCA\\Files_External\\Service\\UserGlobalStoragesService' => __DIR__ . '/..' . '/../lib/Service/UserGlobalStoragesService.php', |
|
| 137 | - 'OCA\\Files_External\\Service\\UserStoragesService' => __DIR__ . '/..' . '/../lib/Service/UserStoragesService.php', |
|
| 138 | - 'OCA\\Files_External\\Service\\UserTrait' => __DIR__ . '/..' . '/../lib/Service/UserTrait.php', |
|
| 139 | - 'OCA\\Files_External\\Settings\\Admin' => __DIR__ . '/..' . '/../lib/Settings/Admin.php', |
|
| 140 | - 'OCA\\Files_External\\Settings\\Personal' => __DIR__ . '/..' . '/../lib/Settings/Personal.php', |
|
| 141 | - 'OCA\\Files_External\\Settings\\PersonalSection' => __DIR__ . '/..' . '/../lib/Settings/PersonalSection.php', |
|
| 142 | - 'OCA\\Files_External\\Settings\\Section' => __DIR__ . '/..' . '/../lib/Settings/Section.php', |
|
| 23 | + public static $classMap = array( |
|
| 24 | + 'Composer\\InstalledVersions' => __DIR__.'/..'.'/composer/InstalledVersions.php', |
|
| 25 | + 'OCA\\Files_External\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php', |
|
| 26 | + 'OCA\\Files_External\\BackgroundJob\\CredentialsCleanup' => __DIR__.'/..'.'/../lib/BackgroundJob/CredentialsCleanup.php', |
|
| 27 | + 'OCA\\Files_External\\Command\\Applicable' => __DIR__.'/..'.'/../lib/Command/Applicable.php', |
|
| 28 | + 'OCA\\Files_External\\Command\\Backends' => __DIR__.'/..'.'/../lib/Command/Backends.php', |
|
| 29 | + 'OCA\\Files_External\\Command\\Config' => __DIR__.'/..'.'/../lib/Command/Config.php', |
|
| 30 | + 'OCA\\Files_External\\Command\\Create' => __DIR__.'/..'.'/../lib/Command/Create.php', |
|
| 31 | + 'OCA\\Files_External\\Command\\Delete' => __DIR__.'/..'.'/../lib/Command/Delete.php', |
|
| 32 | + 'OCA\\Files_External\\Command\\Dependencies' => __DIR__.'/..'.'/../lib/Command/Dependencies.php', |
|
| 33 | + 'OCA\\Files_External\\Command\\Export' => __DIR__.'/..'.'/../lib/Command/Export.php', |
|
| 34 | + 'OCA\\Files_External\\Command\\Import' => __DIR__.'/..'.'/../lib/Command/Import.php', |
|
| 35 | + 'OCA\\Files_External\\Command\\ListCommand' => __DIR__.'/..'.'/../lib/Command/ListCommand.php', |
|
| 36 | + 'OCA\\Files_External\\Command\\Notify' => __DIR__.'/..'.'/../lib/Command/Notify.php', |
|
| 37 | + 'OCA\\Files_External\\Command\\Option' => __DIR__.'/..'.'/../lib/Command/Option.php', |
|
| 38 | + 'OCA\\Files_External\\Command\\Scan' => __DIR__.'/..'.'/../lib/Command/Scan.php', |
|
| 39 | + 'OCA\\Files_External\\Command\\StorageAuthBase' => __DIR__.'/..'.'/../lib/Command/StorageAuthBase.php', |
|
| 40 | + 'OCA\\Files_External\\Command\\Verify' => __DIR__.'/..'.'/../lib/Command/Verify.php', |
|
| 41 | + 'OCA\\Files_External\\ConfigLexicon' => __DIR__.'/..'.'/../lib/ConfigLexicon.php', |
|
| 42 | + 'OCA\\Files_External\\Config\\ConfigAdapter' => __DIR__.'/..'.'/../lib/Config/ConfigAdapter.php', |
|
| 43 | + 'OCA\\Files_External\\Config\\ExternalMountPoint' => __DIR__.'/..'.'/../lib/Config/ExternalMountPoint.php', |
|
| 44 | + 'OCA\\Files_External\\Config\\IConfigHandler' => __DIR__.'/..'.'/../lib/Config/IConfigHandler.php', |
|
| 45 | + 'OCA\\Files_External\\Config\\SimpleSubstitutionTrait' => __DIR__.'/..'.'/../lib/Config/SimpleSubstitutionTrait.php', |
|
| 46 | + 'OCA\\Files_External\\Config\\SystemMountPoint' => __DIR__.'/..'.'/../lib/Config/SystemMountPoint.php', |
|
| 47 | + 'OCA\\Files_External\\Config\\UserContext' => __DIR__.'/..'.'/../lib/Config/UserContext.php', |
|
| 48 | + 'OCA\\Files_External\\Config\\UserPlaceholderHandler' => __DIR__.'/..'.'/../lib/Config/UserPlaceholderHandler.php', |
|
| 49 | + 'OCA\\Files_External\\Controller\\AjaxController' => __DIR__.'/..'.'/../lib/Controller/AjaxController.php', |
|
| 50 | + 'OCA\\Files_External\\Controller\\ApiController' => __DIR__.'/..'.'/../lib/Controller/ApiController.php', |
|
| 51 | + 'OCA\\Files_External\\Controller\\GlobalStoragesController' => __DIR__.'/..'.'/../lib/Controller/GlobalStoragesController.php', |
|
| 52 | + 'OCA\\Files_External\\Controller\\StoragesController' => __DIR__.'/..'.'/../lib/Controller/StoragesController.php', |
|
| 53 | + 'OCA\\Files_External\\Controller\\UserGlobalStoragesController' => __DIR__.'/..'.'/../lib/Controller/UserGlobalStoragesController.php', |
|
| 54 | + 'OCA\\Files_External\\Controller\\UserStoragesController' => __DIR__.'/..'.'/../lib/Controller/UserStoragesController.php', |
|
| 55 | + 'OCA\\Files_External\\Lib\\Auth\\AmazonS3\\AccessKey' => __DIR__.'/..'.'/../lib/Lib/Auth/AmazonS3/AccessKey.php', |
|
| 56 | + 'OCA\\Files_External\\Lib\\Auth\\AuthMechanism' => __DIR__.'/..'.'/../lib/Lib/Auth/AuthMechanism.php', |
|
| 57 | + 'OCA\\Files_External\\Lib\\Auth\\Builtin' => __DIR__.'/..'.'/../lib/Lib/Auth/Builtin.php', |
|
| 58 | + 'OCA\\Files_External\\Lib\\Auth\\IUserProvided' => __DIR__.'/..'.'/../lib/Lib/Auth/IUserProvided.php', |
|
| 59 | + 'OCA\\Files_External\\Lib\\Auth\\InvalidAuth' => __DIR__.'/..'.'/../lib/Lib/Auth/InvalidAuth.php', |
|
| 60 | + 'OCA\\Files_External\\Lib\\Auth\\NullMechanism' => __DIR__.'/..'.'/../lib/Lib/Auth/NullMechanism.php', |
|
| 61 | + 'OCA\\Files_External\\Lib\\Auth\\OAuth2\\OAuth2' => __DIR__.'/..'.'/../lib/Lib/Auth/OAuth2/OAuth2.php', |
|
| 62 | + 'OCA\\Files_External\\Lib\\Auth\\OpenStack\\OpenStackV2' => __DIR__.'/..'.'/../lib/Lib/Auth/OpenStack/OpenStackV2.php', |
|
| 63 | + 'OCA\\Files_External\\Lib\\Auth\\OpenStack\\OpenStackV3' => __DIR__.'/..'.'/../lib/Lib/Auth/OpenStack/OpenStackV3.php', |
|
| 64 | + 'OCA\\Files_External\\Lib\\Auth\\OpenStack\\Rackspace' => __DIR__.'/..'.'/../lib/Lib/Auth/OpenStack/Rackspace.php', |
|
| 65 | + 'OCA\\Files_External\\Lib\\Auth\\Password\\GlobalAuth' => __DIR__.'/..'.'/../lib/Lib/Auth/Password/GlobalAuth.php', |
|
| 66 | + 'OCA\\Files_External\\Lib\\Auth\\Password\\LoginCredentials' => __DIR__.'/..'.'/../lib/Lib/Auth/Password/LoginCredentials.php', |
|
| 67 | + 'OCA\\Files_External\\Lib\\Auth\\Password\\Password' => __DIR__.'/..'.'/../lib/Lib/Auth/Password/Password.php', |
|
| 68 | + 'OCA\\Files_External\\Lib\\Auth\\Password\\SessionCredentials' => __DIR__.'/..'.'/../lib/Lib/Auth/Password/SessionCredentials.php', |
|
| 69 | + 'OCA\\Files_External\\Lib\\Auth\\Password\\UserGlobalAuth' => __DIR__.'/..'.'/../lib/Lib/Auth/Password/UserGlobalAuth.php', |
|
| 70 | + 'OCA\\Files_External\\Lib\\Auth\\Password\\UserProvided' => __DIR__.'/..'.'/../lib/Lib/Auth/Password/UserProvided.php', |
|
| 71 | + 'OCA\\Files_External\\Lib\\Auth\\PublicKey\\RSA' => __DIR__.'/..'.'/../lib/Lib/Auth/PublicKey/RSA.php', |
|
| 72 | + 'OCA\\Files_External\\Lib\\Auth\\PublicKey\\RSAPrivateKey' => __DIR__.'/..'.'/../lib/Lib/Auth/PublicKey/RSAPrivateKey.php', |
|
| 73 | + 'OCA\\Files_External\\Lib\\Auth\\SMB\\KerberosApacheAuth' => __DIR__.'/..'.'/../lib/Lib/Auth/SMB/KerberosApacheAuth.php', |
|
| 74 | + 'OCA\\Files_External\\Lib\\Auth\\SMB\\KerberosAuth' => __DIR__.'/..'.'/../lib/Lib/Auth/SMB/KerberosAuth.php', |
|
| 75 | + 'OCA\\Files_External\\Lib\\Backend\\AmazonS3' => __DIR__.'/..'.'/../lib/Lib/Backend/AmazonS3.php', |
|
| 76 | + 'OCA\\Files_External\\Lib\\Backend\\Backend' => __DIR__.'/..'.'/../lib/Lib/Backend/Backend.php', |
|
| 77 | + 'OCA\\Files_External\\Lib\\Backend\\DAV' => __DIR__.'/..'.'/../lib/Lib/Backend/DAV.php', |
|
| 78 | + 'OCA\\Files_External\\Lib\\Backend\\FTP' => __DIR__.'/..'.'/../lib/Lib/Backend/FTP.php', |
|
| 79 | + 'OCA\\Files_External\\Lib\\Backend\\InvalidBackend' => __DIR__.'/..'.'/../lib/Lib/Backend/InvalidBackend.php', |
|
| 80 | + 'OCA\\Files_External\\Lib\\Backend\\LegacyBackend' => __DIR__.'/..'.'/../lib/Lib/Backend/LegacyBackend.php', |
|
| 81 | + 'OCA\\Files_External\\Lib\\Backend\\Local' => __DIR__.'/..'.'/../lib/Lib/Backend/Local.php', |
|
| 82 | + 'OCA\\Files_External\\Lib\\Backend\\OwnCloud' => __DIR__.'/..'.'/../lib/Lib/Backend/OwnCloud.php', |
|
| 83 | + 'OCA\\Files_External\\Lib\\Backend\\SFTP' => __DIR__.'/..'.'/../lib/Lib/Backend/SFTP.php', |
|
| 84 | + 'OCA\\Files_External\\Lib\\Backend\\SFTP_Key' => __DIR__.'/..'.'/../lib/Lib/Backend/SFTP_Key.php', |
|
| 85 | + 'OCA\\Files_External\\Lib\\Backend\\SMB' => __DIR__.'/..'.'/../lib/Lib/Backend/SMB.php', |
|
| 86 | + 'OCA\\Files_External\\Lib\\Backend\\SMB_OC' => __DIR__.'/..'.'/../lib/Lib/Backend/SMB_OC.php', |
|
| 87 | + 'OCA\\Files_External\\Lib\\Backend\\Swift' => __DIR__.'/..'.'/../lib/Lib/Backend/Swift.php', |
|
| 88 | + 'OCA\\Files_External\\Lib\\Config\\IAuthMechanismProvider' => __DIR__.'/..'.'/../lib/Lib/Config/IAuthMechanismProvider.php', |
|
| 89 | + 'OCA\\Files_External\\Lib\\Config\\IBackendProvider' => __DIR__.'/..'.'/../lib/Lib/Config/IBackendProvider.php', |
|
| 90 | + 'OCA\\Files_External\\Lib\\DefinitionParameter' => __DIR__.'/..'.'/../lib/Lib/DefinitionParameter.php', |
|
| 91 | + 'OCA\\Files_External\\Lib\\DependencyTrait' => __DIR__.'/..'.'/../lib/Lib/DependencyTrait.php', |
|
| 92 | + 'OCA\\Files_External\\Lib\\FrontendDefinitionTrait' => __DIR__.'/..'.'/../lib/Lib/FrontendDefinitionTrait.php', |
|
| 93 | + 'OCA\\Files_External\\Lib\\IFrontendDefinition' => __DIR__.'/..'.'/../lib/Lib/IFrontendDefinition.php', |
|
| 94 | + 'OCA\\Files_External\\Lib\\IIdentifier' => __DIR__.'/..'.'/../lib/Lib/IIdentifier.php', |
|
| 95 | + 'OCA\\Files_External\\Lib\\IdentifierTrait' => __DIR__.'/..'.'/../lib/Lib/IdentifierTrait.php', |
|
| 96 | + 'OCA\\Files_External\\Lib\\InsufficientDataForMeaningfulAnswerException' => __DIR__.'/..'.'/../lib/Lib/InsufficientDataForMeaningfulAnswerException.php', |
|
| 97 | + 'OCA\\Files_External\\Lib\\LegacyDependencyCheckPolyfill' => __DIR__.'/..'.'/../lib/Lib/LegacyDependencyCheckPolyfill.php', |
|
| 98 | + 'OCA\\Files_External\\Lib\\MissingDependency' => __DIR__.'/..'.'/../lib/Lib/MissingDependency.php', |
|
| 99 | + 'OCA\\Files_External\\Lib\\Notify\\SMBNotifyHandler' => __DIR__.'/..'.'/../lib/Lib/Notify/SMBNotifyHandler.php', |
|
| 100 | + 'OCA\\Files_External\\Lib\\PersonalMount' => __DIR__.'/..'.'/../lib/Lib/PersonalMount.php', |
|
| 101 | + 'OCA\\Files_External\\Lib\\PriorityTrait' => __DIR__.'/..'.'/../lib/Lib/PriorityTrait.php', |
|
| 102 | + 'OCA\\Files_External\\Lib\\SessionStorageWrapper' => __DIR__.'/..'.'/../lib/Lib/SessionStorageWrapper.php', |
|
| 103 | + 'OCA\\Files_External\\Lib\\StorageConfig' => __DIR__.'/..'.'/../lib/Lib/StorageConfig.php', |
|
| 104 | + 'OCA\\Files_External\\Lib\\StorageModifierTrait' => __DIR__.'/..'.'/../lib/Lib/StorageModifierTrait.php', |
|
| 105 | + 'OCA\\Files_External\\Lib\\Storage\\AmazonS3' => __DIR__.'/..'.'/../lib/Lib/Storage/AmazonS3.php', |
|
| 106 | + 'OCA\\Files_External\\Lib\\Storage\\FTP' => __DIR__.'/..'.'/../lib/Lib/Storage/FTP.php', |
|
| 107 | + 'OCA\\Files_External\\Lib\\Storage\\FtpConnection' => __DIR__.'/..'.'/../lib/Lib/Storage/FtpConnection.php', |
|
| 108 | + 'OCA\\Files_External\\Lib\\Storage\\OwnCloud' => __DIR__.'/..'.'/../lib/Lib/Storage/OwnCloud.php', |
|
| 109 | + 'OCA\\Files_External\\Lib\\Storage\\SFTP' => __DIR__.'/..'.'/../lib/Lib/Storage/SFTP.php', |
|
| 110 | + 'OCA\\Files_External\\Lib\\Storage\\SFTPReadStream' => __DIR__.'/..'.'/../lib/Lib/Storage/SFTPReadStream.php', |
|
| 111 | + 'OCA\\Files_External\\Lib\\Storage\\SFTPWriteStream' => __DIR__.'/..'.'/../lib/Lib/Storage/SFTPWriteStream.php', |
|
| 112 | + 'OCA\\Files_External\\Lib\\Storage\\SMB' => __DIR__.'/..'.'/../lib/Lib/Storage/SMB.php', |
|
| 113 | + 'OCA\\Files_External\\Lib\\Storage\\StreamWrapper' => __DIR__.'/..'.'/../lib/Lib/Storage/StreamWrapper.php', |
|
| 114 | + 'OCA\\Files_External\\Lib\\Storage\\Swift' => __DIR__.'/..'.'/../lib/Lib/Storage/Swift.php', |
|
| 115 | + 'OCA\\Files_External\\Lib\\Storage\\SystemBridge' => __DIR__.'/..'.'/../lib/Lib/Storage/SystemBridge.php', |
|
| 116 | + 'OCA\\Files_External\\Lib\\VisibilityTrait' => __DIR__.'/..'.'/../lib/Lib/VisibilityTrait.php', |
|
| 117 | + 'OCA\\Files_External\\Listener\\GroupDeletedListener' => __DIR__.'/..'.'/../lib/Listener/GroupDeletedListener.php', |
|
| 118 | + 'OCA\\Files_External\\Listener\\LoadAdditionalListener' => __DIR__.'/..'.'/../lib/Listener/LoadAdditionalListener.php', |
|
| 119 | + 'OCA\\Files_External\\Listener\\StorePasswordListener' => __DIR__.'/..'.'/../lib/Listener/StorePasswordListener.php', |
|
| 120 | + 'OCA\\Files_External\\Listener\\UserDeletedListener' => __DIR__.'/..'.'/../lib/Listener/UserDeletedListener.php', |
|
| 121 | + 'OCA\\Files_External\\Migration\\DummyUserSession' => __DIR__.'/..'.'/../lib/Migration/DummyUserSession.php', |
|
| 122 | + 'OCA\\Files_External\\Migration\\Version1011Date20200630192246' => __DIR__.'/..'.'/../lib/Migration/Version1011Date20200630192246.php', |
|
| 123 | + 'OCA\\Files_External\\Migration\\Version1015Date20211104103506' => __DIR__.'/..'.'/../lib/Migration/Version1015Date20211104103506.php', |
|
| 124 | + 'OCA\\Files_External\\Migration\\Version1016Date20220324154536' => __DIR__.'/..'.'/../lib/Migration/Version1016Date20220324154536.php', |
|
| 125 | + 'OCA\\Files_External\\Migration\\Version1025Date20250228162604' => __DIR__.'/..'.'/../lib/Migration/Version1025Date20250228162604.php', |
|
| 126 | + 'OCA\\Files_External\\Migration\\Version22000Date20210216084416' => __DIR__.'/..'.'/../lib/Migration/Version22000Date20210216084416.php', |
|
| 127 | + 'OCA\\Files_External\\MountConfig' => __DIR__.'/..'.'/../lib/MountConfig.php', |
|
| 128 | + 'OCA\\Files_External\\NotFoundException' => __DIR__.'/..'.'/../lib/NotFoundException.php', |
|
| 129 | + 'OCA\\Files_External\\ResponseDefinitions' => __DIR__.'/..'.'/../lib/ResponseDefinitions.php', |
|
| 130 | + 'OCA\\Files_External\\Service\\BackendService' => __DIR__.'/..'.'/../lib/Service/BackendService.php', |
|
| 131 | + 'OCA\\Files_External\\Service\\DBConfigService' => __DIR__.'/..'.'/../lib/Service/DBConfigService.php', |
|
| 132 | + 'OCA\\Files_External\\Service\\GlobalStoragesService' => __DIR__.'/..'.'/../lib/Service/GlobalStoragesService.php', |
|
| 133 | + 'OCA\\Files_External\\Service\\ImportLegacyStoragesService' => __DIR__.'/..'.'/../lib/Service/ImportLegacyStoragesService.php', |
|
| 134 | + 'OCA\\Files_External\\Service\\LegacyStoragesService' => __DIR__.'/..'.'/../lib/Service/LegacyStoragesService.php', |
|
| 135 | + 'OCA\\Files_External\\Service\\StoragesService' => __DIR__.'/..'.'/../lib/Service/StoragesService.php', |
|
| 136 | + 'OCA\\Files_External\\Service\\UserGlobalStoragesService' => __DIR__.'/..'.'/../lib/Service/UserGlobalStoragesService.php', |
|
| 137 | + 'OCA\\Files_External\\Service\\UserStoragesService' => __DIR__.'/..'.'/../lib/Service/UserStoragesService.php', |
|
| 138 | + 'OCA\\Files_External\\Service\\UserTrait' => __DIR__.'/..'.'/../lib/Service/UserTrait.php', |
|
| 139 | + 'OCA\\Files_External\\Settings\\Admin' => __DIR__.'/..'.'/../lib/Settings/Admin.php', |
|
| 140 | + 'OCA\\Files_External\\Settings\\Personal' => __DIR__.'/..'.'/../lib/Settings/Personal.php', |
|
| 141 | + 'OCA\\Files_External\\Settings\\PersonalSection' => __DIR__.'/..'.'/../lib/Settings/PersonalSection.php', |
|
| 142 | + 'OCA\\Files_External\\Settings\\Section' => __DIR__.'/..'.'/../lib/Settings/Section.php', |
|
| 143 | 143 | ); |
| 144 | 144 | |
| 145 | 145 | public static function getInitializer(ClassLoader $loader) |
| 146 | 146 | { |
| 147 | - return \Closure::bind(function () use ($loader) { |
|
| 147 | + return \Closure::bind(function() use ($loader) { |
|
| 148 | 148 | $loader->prefixLengthsPsr4 = ComposerStaticInitFiles_External::$prefixLengthsPsr4; |
| 149 | 149 | $loader->prefixDirsPsr4 = ComposerStaticInitFiles_External::$prefixDirsPsr4; |
| 150 | 150 | $loader->classMap = ComposerStaticInitFiles_External::$classMap; |
@@ -21,26 +21,26 @@ |
||
| 21 | 21 | * {@see ILexicon} |
| 22 | 22 | */ |
| 23 | 23 | class ConfigLexicon implements ILexicon { |
| 24 | - public const OVERWRITES_HOME_FOLDERS = 'overwrites_home_folders'; |
|
| 24 | + public const OVERWRITES_HOME_FOLDERS = 'overwrites_home_folders'; |
|
| 25 | 25 | |
| 26 | - public function getStrictness(): Strictness { |
|
| 27 | - return Strictness::NOTICE; |
|
| 28 | - } |
|
| 26 | + public function getStrictness(): Strictness { |
|
| 27 | + return Strictness::NOTICE; |
|
| 28 | + } |
|
| 29 | 29 | |
| 30 | - public function getAppConfigs(): array { |
|
| 31 | - return [ |
|
| 32 | - new Entry( |
|
| 33 | - self::OVERWRITES_HOME_FOLDERS, |
|
| 34 | - ValueType::ARRAY, |
|
| 35 | - defaultRaw: [], |
|
| 36 | - definition: 'List of applications overwriting home folders', |
|
| 37 | - lazy: false, |
|
| 38 | - note: 'It will be populated with app IDs of mount providers that overwrite home folders. Currently, only files_external and groupfolders.', |
|
| 39 | - ), |
|
| 40 | - ]; |
|
| 41 | - } |
|
| 30 | + public function getAppConfigs(): array { |
|
| 31 | + return [ |
|
| 32 | + new Entry( |
|
| 33 | + self::OVERWRITES_HOME_FOLDERS, |
|
| 34 | + ValueType::ARRAY, |
|
| 35 | + defaultRaw: [], |
|
| 36 | + definition: 'List of applications overwriting home folders', |
|
| 37 | + lazy: false, |
|
| 38 | + note: 'It will be populated with app IDs of mount providers that overwrite home folders. Currently, only files_external and groupfolders.', |
|
| 39 | + ), |
|
| 40 | + ]; |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - public function getUserConfigs(): array { |
|
| 44 | - return []; |
|
| 45 | - } |
|
| 43 | + public function getUserConfigs(): array { |
|
| 44 | + return []; |
|
| 45 | + } |
|
| 46 | 46 | } |
@@ -58,89 +58,89 @@ |
||
| 58 | 58 | use Psr\Log\LoggerInterface; |
| 59 | 59 | |
| 60 | 60 | class Application extends App implements IBootstrap { |
| 61 | - public const APP_ID = 'files'; |
|
| 62 | - |
|
| 63 | - public function __construct(array $urlParams = []) { |
|
| 64 | - parent::__construct(self::APP_ID, $urlParams); |
|
| 65 | - } |
|
| 66 | - |
|
| 67 | - public function register(IRegistrationContext $context): void { |
|
| 68 | - /** |
|
| 69 | - * Controllers |
|
| 70 | - */ |
|
| 71 | - $context->registerService('APIController', function (ContainerInterface $c) { |
|
| 72 | - /** @var IServerContainer $server */ |
|
| 73 | - $server = $c->get(IServerContainer::class); |
|
| 74 | - |
|
| 75 | - return new ApiController( |
|
| 76 | - $c->get('AppName'), |
|
| 77 | - $c->get(IRequest::class), |
|
| 78 | - $c->get(IUserSession::class), |
|
| 79 | - $c->get(TagService::class), |
|
| 80 | - $c->get(IPreview::class), |
|
| 81 | - $c->get(IShareManager::class), |
|
| 82 | - $c->get(IConfig::class), |
|
| 83 | - $server->getUserFolder(), |
|
| 84 | - $c->get(UserConfig::class), |
|
| 85 | - $c->get(ViewConfig::class), |
|
| 86 | - $c->get(IL10N::class), |
|
| 87 | - $c->get(IRootFolder::class), |
|
| 88 | - $c->get(LoggerInterface::class), |
|
| 89 | - ); |
|
| 90 | - }); |
|
| 91 | - |
|
| 92 | - /** |
|
| 93 | - * Services |
|
| 94 | - */ |
|
| 95 | - $context->registerService(TagService::class, function (ContainerInterface $c) { |
|
| 96 | - /** @var IServerContainer $server */ |
|
| 97 | - $server = $c->get(IServerContainer::class); |
|
| 98 | - |
|
| 99 | - return new TagService( |
|
| 100 | - $c->get(IUserSession::class), |
|
| 101 | - $c->get(IActivityManager::class), |
|
| 102 | - $c->get(ITagManager::class)->load(self::APP_ID), |
|
| 103 | - $server->getUserFolder(), |
|
| 104 | - ); |
|
| 105 | - }); |
|
| 106 | - |
|
| 107 | - /* |
|
| 61 | + public const APP_ID = 'files'; |
|
| 62 | + |
|
| 63 | + public function __construct(array $urlParams = []) { |
|
| 64 | + parent::__construct(self::APP_ID, $urlParams); |
|
| 65 | + } |
|
| 66 | + |
|
| 67 | + public function register(IRegistrationContext $context): void { |
|
| 68 | + /** |
|
| 69 | + * Controllers |
|
| 70 | + */ |
|
| 71 | + $context->registerService('APIController', function (ContainerInterface $c) { |
|
| 72 | + /** @var IServerContainer $server */ |
|
| 73 | + $server = $c->get(IServerContainer::class); |
|
| 74 | + |
|
| 75 | + return new ApiController( |
|
| 76 | + $c->get('AppName'), |
|
| 77 | + $c->get(IRequest::class), |
|
| 78 | + $c->get(IUserSession::class), |
|
| 79 | + $c->get(TagService::class), |
|
| 80 | + $c->get(IPreview::class), |
|
| 81 | + $c->get(IShareManager::class), |
|
| 82 | + $c->get(IConfig::class), |
|
| 83 | + $server->getUserFolder(), |
|
| 84 | + $c->get(UserConfig::class), |
|
| 85 | + $c->get(ViewConfig::class), |
|
| 86 | + $c->get(IL10N::class), |
|
| 87 | + $c->get(IRootFolder::class), |
|
| 88 | + $c->get(LoggerInterface::class), |
|
| 89 | + ); |
|
| 90 | + }); |
|
| 91 | + |
|
| 92 | + /** |
|
| 93 | + * Services |
|
| 94 | + */ |
|
| 95 | + $context->registerService(TagService::class, function (ContainerInterface $c) { |
|
| 96 | + /** @var IServerContainer $server */ |
|
| 97 | + $server = $c->get(IServerContainer::class); |
|
| 98 | + |
|
| 99 | + return new TagService( |
|
| 100 | + $c->get(IUserSession::class), |
|
| 101 | + $c->get(IActivityManager::class), |
|
| 102 | + $c->get(ITagManager::class)->load(self::APP_ID), |
|
| 103 | + $server->getUserFolder(), |
|
| 104 | + ); |
|
| 105 | + }); |
|
| 106 | + |
|
| 107 | + /* |
|
| 108 | 108 | * Register capabilities |
| 109 | 109 | */ |
| 110 | - $context->registerCapability(Capabilities::class); |
|
| 111 | - $context->registerCapability(AdvancedCapabilities::class); |
|
| 112 | - $context->registerCapability(DirectEditingCapabilities::class); |
|
| 113 | - |
|
| 114 | - $context->registerEventListener(LoadSidebar::class, LoadSidebarListener::class); |
|
| 115 | - $context->registerEventListener(RenderReferenceEvent::class, RenderReferenceEventListener::class); |
|
| 116 | - $context->registerEventListener(BeforeNodeRenamedEvent::class, SyncLivePhotosListener::class); |
|
| 117 | - $context->registerEventListener(BeforeNodeDeletedEvent::class, SyncLivePhotosListener::class); |
|
| 118 | - $context->registerEventListener(CacheEntryRemovedEvent::class, SyncLivePhotosListener::class, 1); // Ensure this happen before the metadata are deleted. |
|
| 119 | - $context->registerEventListener(BeforeNodeCopiedEvent::class, SyncLivePhotosListener::class); |
|
| 120 | - $context->registerEventListener(NodeCopiedEvent::class, SyncLivePhotosListener::class); |
|
| 121 | - $context->registerEventListener(LoadSearchPlugins::class, LoadSearchPluginsListener::class); |
|
| 122 | - $context->registerEventListener(NodeAddedToFavorite::class, NodeAddedToFavoriteListener::class); |
|
| 123 | - $context->registerEventListener(NodeRemovedFromFavorite::class, NodeRemovedFromFavoriteListener::class); |
|
| 124 | - $context->registerSearchProvider(FilesSearchProvider::class); |
|
| 125 | - |
|
| 126 | - $context->registerNotifierService(Notifier::class); |
|
| 127 | - $context->registerDashboardWidget(FavoriteWidget::class); |
|
| 128 | - |
|
| 129 | - $context->registerConfigLexicon(ConfigLexicon::class); |
|
| 130 | - |
|
| 131 | - } |
|
| 132 | - |
|
| 133 | - public function boot(IBootContext $context): void { |
|
| 134 | - $context->injectFn(Closure::fromCallable([$this, 'registerCollaboration'])); |
|
| 135 | - $context->injectFn([Listener::class, 'register']); |
|
| 136 | - $this->registerHooks(); |
|
| 137 | - } |
|
| 138 | - |
|
| 139 | - private function registerCollaboration(IProviderManager $providerManager): void { |
|
| 140 | - $providerManager->registerResourceProvider(ResourceProvider::class); |
|
| 141 | - } |
|
| 142 | - |
|
| 143 | - private function registerHooks(): void { |
|
| 144 | - Util::connectHook('\OCP\Config', 'js', '\OCA\Files\App', 'extendJsConfig'); |
|
| 145 | - } |
|
| 110 | + $context->registerCapability(Capabilities::class); |
|
| 111 | + $context->registerCapability(AdvancedCapabilities::class); |
|
| 112 | + $context->registerCapability(DirectEditingCapabilities::class); |
|
| 113 | + |
|
| 114 | + $context->registerEventListener(LoadSidebar::class, LoadSidebarListener::class); |
|
| 115 | + $context->registerEventListener(RenderReferenceEvent::class, RenderReferenceEventListener::class); |
|
| 116 | + $context->registerEventListener(BeforeNodeRenamedEvent::class, SyncLivePhotosListener::class); |
|
| 117 | + $context->registerEventListener(BeforeNodeDeletedEvent::class, SyncLivePhotosListener::class); |
|
| 118 | + $context->registerEventListener(CacheEntryRemovedEvent::class, SyncLivePhotosListener::class, 1); // Ensure this happen before the metadata are deleted. |
|
| 119 | + $context->registerEventListener(BeforeNodeCopiedEvent::class, SyncLivePhotosListener::class); |
|
| 120 | + $context->registerEventListener(NodeCopiedEvent::class, SyncLivePhotosListener::class); |
|
| 121 | + $context->registerEventListener(LoadSearchPlugins::class, LoadSearchPluginsListener::class); |
|
| 122 | + $context->registerEventListener(NodeAddedToFavorite::class, NodeAddedToFavoriteListener::class); |
|
| 123 | + $context->registerEventListener(NodeRemovedFromFavorite::class, NodeRemovedFromFavoriteListener::class); |
|
| 124 | + $context->registerSearchProvider(FilesSearchProvider::class); |
|
| 125 | + |
|
| 126 | + $context->registerNotifierService(Notifier::class); |
|
| 127 | + $context->registerDashboardWidget(FavoriteWidget::class); |
|
| 128 | + |
|
| 129 | + $context->registerConfigLexicon(ConfigLexicon::class); |
|
| 130 | + |
|
| 131 | + } |
|
| 132 | + |
|
| 133 | + public function boot(IBootContext $context): void { |
|
| 134 | + $context->injectFn(Closure::fromCallable([$this, 'registerCollaboration'])); |
|
| 135 | + $context->injectFn([Listener::class, 'register']); |
|
| 136 | + $this->registerHooks(); |
|
| 137 | + } |
|
| 138 | + |
|
| 139 | + private function registerCollaboration(IProviderManager $providerManager): void { |
|
| 140 | + $providerManager->registerResourceProvider(ResourceProvider::class); |
|
| 141 | + } |
|
| 142 | + |
|
| 143 | + private function registerHooks(): void { |
|
| 144 | + Util::connectHook('\OCP\Config', 'js', '\OCA\Files\App', 'extendJsConfig'); |
|
| 145 | + } |
|
| 146 | 146 | } |
@@ -6,91 +6,91 @@ |
||
| 6 | 6 | $baseDir = $vendorDir; |
| 7 | 7 | |
| 8 | 8 | return array( |
| 9 | - 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', |
|
| 10 | - 'OCA\\Files\\Activity\\FavoriteProvider' => $baseDir . '/../lib/Activity/FavoriteProvider.php', |
|
| 11 | - 'OCA\\Files\\Activity\\Filter\\Favorites' => $baseDir . '/../lib/Activity/Filter/Favorites.php', |
|
| 12 | - 'OCA\\Files\\Activity\\Filter\\FileChanges' => $baseDir . '/../lib/Activity/Filter/FileChanges.php', |
|
| 13 | - 'OCA\\Files\\Activity\\Helper' => $baseDir . '/../lib/Activity/Helper.php', |
|
| 14 | - 'OCA\\Files\\Activity\\Provider' => $baseDir . '/../lib/Activity/Provider.php', |
|
| 15 | - 'OCA\\Files\\Activity\\Settings\\FavoriteAction' => $baseDir . '/../lib/Activity/Settings/FavoriteAction.php', |
|
| 16 | - 'OCA\\Files\\Activity\\Settings\\FileActivitySettings' => $baseDir . '/../lib/Activity/Settings/FileActivitySettings.php', |
|
| 17 | - 'OCA\\Files\\Activity\\Settings\\FileChanged' => $baseDir . '/../lib/Activity/Settings/FileChanged.php', |
|
| 18 | - 'OCA\\Files\\Activity\\Settings\\FileFavoriteChanged' => $baseDir . '/../lib/Activity/Settings/FileFavoriteChanged.php', |
|
| 19 | - 'OCA\\Files\\AdvancedCapabilities' => $baseDir . '/../lib/AdvancedCapabilities.php', |
|
| 20 | - 'OCA\\Files\\App' => $baseDir . '/../lib/App.php', |
|
| 21 | - 'OCA\\Files\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php', |
|
| 22 | - 'OCA\\Files\\BackgroundJob\\CleanupDirectEditingTokens' => $baseDir . '/../lib/BackgroundJob/CleanupDirectEditingTokens.php', |
|
| 23 | - 'OCA\\Files\\BackgroundJob\\CleanupFileLocks' => $baseDir . '/../lib/BackgroundJob/CleanupFileLocks.php', |
|
| 24 | - 'OCA\\Files\\BackgroundJob\\DeleteExpiredOpenLocalEditor' => $baseDir . '/../lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php', |
|
| 25 | - 'OCA\\Files\\BackgroundJob\\DeleteOrphanedItems' => $baseDir . '/../lib/BackgroundJob/DeleteOrphanedItems.php', |
|
| 26 | - 'OCA\\Files\\BackgroundJob\\SanitizeFilenames' => $baseDir . '/../lib/BackgroundJob/SanitizeFilenames.php', |
|
| 27 | - 'OCA\\Files\\BackgroundJob\\ScanFiles' => $baseDir . '/../lib/BackgroundJob/ScanFiles.php', |
|
| 28 | - 'OCA\\Files\\BackgroundJob\\TransferOwnership' => $baseDir . '/../lib/BackgroundJob/TransferOwnership.php', |
|
| 29 | - 'OCA\\Files\\Capabilities' => $baseDir . '/../lib/Capabilities.php', |
|
| 30 | - 'OCA\\Files\\Collaboration\\Resources\\Listener' => $baseDir . '/../lib/Collaboration/Resources/Listener.php', |
|
| 31 | - 'OCA\\Files\\Collaboration\\Resources\\ResourceProvider' => $baseDir . '/../lib/Collaboration/Resources/ResourceProvider.php', |
|
| 32 | - 'OCA\\Files\\Command\\Copy' => $baseDir . '/../lib/Command/Copy.php', |
|
| 33 | - 'OCA\\Files\\Command\\Delete' => $baseDir . '/../lib/Command/Delete.php', |
|
| 34 | - 'OCA\\Files\\Command\\DeleteOrphanedFiles' => $baseDir . '/../lib/Command/DeleteOrphanedFiles.php', |
|
| 35 | - 'OCA\\Files\\Command\\Get' => $baseDir . '/../lib/Command/Get.php', |
|
| 36 | - 'OCA\\Files\\Command\\Move' => $baseDir . '/../lib/Command/Move.php', |
|
| 37 | - 'OCA\\Files\\Command\\Object\\Delete' => $baseDir . '/../lib/Command/Object/Delete.php', |
|
| 38 | - 'OCA\\Files\\Command\\Object\\Get' => $baseDir . '/../lib/Command/Object/Get.php', |
|
| 39 | - 'OCA\\Files\\Command\\Object\\Info' => $baseDir . '/../lib/Command/Object/Info.php', |
|
| 40 | - 'OCA\\Files\\Command\\Object\\ListObject' => $baseDir . '/../lib/Command/Object/ListObject.php', |
|
| 41 | - 'OCA\\Files\\Command\\Object\\Multi\\Rename' => $baseDir . '/../lib/Command/Object/Multi/Rename.php', |
|
| 42 | - 'OCA\\Files\\Command\\Object\\Multi\\Users' => $baseDir . '/../lib/Command/Object/Multi/Users.php', |
|
| 43 | - 'OCA\\Files\\Command\\Object\\ObjectUtil' => $baseDir . '/../lib/Command/Object/ObjectUtil.php', |
|
| 44 | - 'OCA\\Files\\Command\\Object\\Orphans' => $baseDir . '/../lib/Command/Object/Orphans.php', |
|
| 45 | - 'OCA\\Files\\Command\\Object\\Put' => $baseDir . '/../lib/Command/Object/Put.php', |
|
| 46 | - 'OCA\\Files\\Command\\Put' => $baseDir . '/../lib/Command/Put.php', |
|
| 47 | - 'OCA\\Files\\Command\\RepairTree' => $baseDir . '/../lib/Command/RepairTree.php', |
|
| 48 | - 'OCA\\Files\\Command\\SanitizeFilenames' => $baseDir . '/../lib/Command/SanitizeFilenames.php', |
|
| 49 | - 'OCA\\Files\\Command\\Scan' => $baseDir . '/../lib/Command/Scan.php', |
|
| 50 | - 'OCA\\Files\\Command\\ScanAppData' => $baseDir . '/../lib/Command/ScanAppData.php', |
|
| 51 | - 'OCA\\Files\\Command\\TransferOwnership' => $baseDir . '/../lib/Command/TransferOwnership.php', |
|
| 52 | - 'OCA\\Files\\Command\\WindowsCompatibleFilenames' => $baseDir . '/../lib/Command/WindowsCompatibleFilenames.php', |
|
| 53 | - 'OCA\\Files\\ConfigLexicon' => $baseDir . '/../lib/ConfigLexicon.php', |
|
| 54 | - 'OCA\\Files\\Controller\\ApiController' => $baseDir . '/../lib/Controller/ApiController.php', |
|
| 55 | - 'OCA\\Files\\Controller\\ConversionApiController' => $baseDir . '/../lib/Controller/ConversionApiController.php', |
|
| 56 | - 'OCA\\Files\\Controller\\DirectEditingController' => $baseDir . '/../lib/Controller/DirectEditingController.php', |
|
| 57 | - 'OCA\\Files\\Controller\\DirectEditingViewController' => $baseDir . '/../lib/Controller/DirectEditingViewController.php', |
|
| 58 | - 'OCA\\Files\\Controller\\FilenamesController' => $baseDir . '/../lib/Controller/FilenamesController.php', |
|
| 59 | - 'OCA\\Files\\Controller\\OpenLocalEditorController' => $baseDir . '/../lib/Controller/OpenLocalEditorController.php', |
|
| 60 | - 'OCA\\Files\\Controller\\TemplateController' => $baseDir . '/../lib/Controller/TemplateController.php', |
|
| 61 | - 'OCA\\Files\\Controller\\TransferOwnershipController' => $baseDir . '/../lib/Controller/TransferOwnershipController.php', |
|
| 62 | - 'OCA\\Files\\Controller\\ViewController' => $baseDir . '/../lib/Controller/ViewController.php', |
|
| 63 | - 'OCA\\Files\\Dashboard\\FavoriteWidget' => $baseDir . '/../lib/Dashboard/FavoriteWidget.php', |
|
| 64 | - 'OCA\\Files\\Db\\OpenLocalEditor' => $baseDir . '/../lib/Db/OpenLocalEditor.php', |
|
| 65 | - 'OCA\\Files\\Db\\OpenLocalEditorMapper' => $baseDir . '/../lib/Db/OpenLocalEditorMapper.php', |
|
| 66 | - 'OCA\\Files\\Db\\TransferOwnership' => $baseDir . '/../lib/Db/TransferOwnership.php', |
|
| 67 | - 'OCA\\Files\\Db\\TransferOwnershipMapper' => $baseDir . '/../lib/Db/TransferOwnershipMapper.php', |
|
| 68 | - 'OCA\\Files\\DirectEditingCapabilities' => $baseDir . '/../lib/DirectEditingCapabilities.php', |
|
| 69 | - 'OCA\\Files\\Event\\LoadAdditionalScriptsEvent' => $baseDir . '/../lib/Event/LoadAdditionalScriptsEvent.php', |
|
| 70 | - 'OCA\\Files\\Event\\LoadSearchPlugins' => $baseDir . '/../lib/Event/LoadSearchPlugins.php', |
|
| 71 | - 'OCA\\Files\\Event\\LoadSidebar' => $baseDir . '/../lib/Event/LoadSidebar.php', |
|
| 72 | - 'OCA\\Files\\Exception\\TransferOwnershipException' => $baseDir . '/../lib/Exception/TransferOwnershipException.php', |
|
| 73 | - 'OCA\\Files\\Helper' => $baseDir . '/../lib/Helper.php', |
|
| 74 | - 'OCA\\Files\\Listener\\LoadSearchPluginsListener' => $baseDir . '/../lib/Listener/LoadSearchPluginsListener.php', |
|
| 75 | - 'OCA\\Files\\Listener\\LoadSidebarListener' => $baseDir . '/../lib/Listener/LoadSidebarListener.php', |
|
| 76 | - 'OCA\\Files\\Listener\\NodeAddedToFavoriteListener' => $baseDir . '/../lib/Listener/NodeAddedToFavoriteListener.php', |
|
| 77 | - 'OCA\\Files\\Listener\\NodeRemovedFromFavoriteListener' => $baseDir . '/../lib/Listener/NodeRemovedFromFavoriteListener.php', |
|
| 78 | - 'OCA\\Files\\Listener\\RenderReferenceEventListener' => $baseDir . '/../lib/Listener/RenderReferenceEventListener.php', |
|
| 79 | - 'OCA\\Files\\Listener\\SyncLivePhotosListener' => $baseDir . '/../lib/Listener/SyncLivePhotosListener.php', |
|
| 80 | - 'OCA\\Files\\Migration\\Version11301Date20191205150729' => $baseDir . '/../lib/Migration/Version11301Date20191205150729.php', |
|
| 81 | - 'OCA\\Files\\Migration\\Version12101Date20221011153334' => $baseDir . '/../lib/Migration/Version12101Date20221011153334.php', |
|
| 82 | - 'OCA\\Files\\Migration\\Version2003Date20241021095629' => $baseDir . '/../lib/Migration/Version2003Date20241021095629.php', |
|
| 83 | - 'OCA\\Files\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php', |
|
| 84 | - 'OCA\\Files\\ResponseDefinitions' => $baseDir . '/../lib/ResponseDefinitions.php', |
|
| 85 | - 'OCA\\Files\\Search\\FilesSearchProvider' => $baseDir . '/../lib/Search/FilesSearchProvider.php', |
|
| 86 | - 'OCA\\Files\\Service\\ChunkedUploadConfig' => $baseDir . '/../lib/Service/ChunkedUploadConfig.php', |
|
| 87 | - 'OCA\\Files\\Service\\DirectEditingService' => $baseDir . '/../lib/Service/DirectEditingService.php', |
|
| 88 | - 'OCA\\Files\\Service\\LivePhotosService' => $baseDir . '/../lib/Service/LivePhotosService.php', |
|
| 89 | - 'OCA\\Files\\Service\\OwnershipTransferService' => $baseDir . '/../lib/Service/OwnershipTransferService.php', |
|
| 90 | - 'OCA\\Files\\Service\\SettingsService' => $baseDir . '/../lib/Service/SettingsService.php', |
|
| 91 | - 'OCA\\Files\\Service\\TagService' => $baseDir . '/../lib/Service/TagService.php', |
|
| 92 | - 'OCA\\Files\\Service\\UserConfig' => $baseDir . '/../lib/Service/UserConfig.php', |
|
| 93 | - 'OCA\\Files\\Service\\ViewConfig' => $baseDir . '/../lib/Service/ViewConfig.php', |
|
| 94 | - 'OCA\\Files\\Settings\\AdminSettings' => $baseDir . '/../lib/Settings/AdminSettings.php', |
|
| 95 | - 'OCA\\Files\\Settings\\PersonalSettings' => $baseDir . '/../lib/Settings/PersonalSettings.php', |
|
| 9 | + 'Composer\\InstalledVersions' => $vendorDir.'/composer/InstalledVersions.php', |
|
| 10 | + 'OCA\\Files\\Activity\\FavoriteProvider' => $baseDir.'/../lib/Activity/FavoriteProvider.php', |
|
| 11 | + 'OCA\\Files\\Activity\\Filter\\Favorites' => $baseDir.'/../lib/Activity/Filter/Favorites.php', |
|
| 12 | + 'OCA\\Files\\Activity\\Filter\\FileChanges' => $baseDir.'/../lib/Activity/Filter/FileChanges.php', |
|
| 13 | + 'OCA\\Files\\Activity\\Helper' => $baseDir.'/../lib/Activity/Helper.php', |
|
| 14 | + 'OCA\\Files\\Activity\\Provider' => $baseDir.'/../lib/Activity/Provider.php', |
|
| 15 | + 'OCA\\Files\\Activity\\Settings\\FavoriteAction' => $baseDir.'/../lib/Activity/Settings/FavoriteAction.php', |
|
| 16 | + 'OCA\\Files\\Activity\\Settings\\FileActivitySettings' => $baseDir.'/../lib/Activity/Settings/FileActivitySettings.php', |
|
| 17 | + 'OCA\\Files\\Activity\\Settings\\FileChanged' => $baseDir.'/../lib/Activity/Settings/FileChanged.php', |
|
| 18 | + 'OCA\\Files\\Activity\\Settings\\FileFavoriteChanged' => $baseDir.'/../lib/Activity/Settings/FileFavoriteChanged.php', |
|
| 19 | + 'OCA\\Files\\AdvancedCapabilities' => $baseDir.'/../lib/AdvancedCapabilities.php', |
|
| 20 | + 'OCA\\Files\\App' => $baseDir.'/../lib/App.php', |
|
| 21 | + 'OCA\\Files\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php', |
|
| 22 | + 'OCA\\Files\\BackgroundJob\\CleanupDirectEditingTokens' => $baseDir.'/../lib/BackgroundJob/CleanupDirectEditingTokens.php', |
|
| 23 | + 'OCA\\Files\\BackgroundJob\\CleanupFileLocks' => $baseDir.'/../lib/BackgroundJob/CleanupFileLocks.php', |
|
| 24 | + 'OCA\\Files\\BackgroundJob\\DeleteExpiredOpenLocalEditor' => $baseDir.'/../lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php', |
|
| 25 | + 'OCA\\Files\\BackgroundJob\\DeleteOrphanedItems' => $baseDir.'/../lib/BackgroundJob/DeleteOrphanedItems.php', |
|
| 26 | + 'OCA\\Files\\BackgroundJob\\SanitizeFilenames' => $baseDir.'/../lib/BackgroundJob/SanitizeFilenames.php', |
|
| 27 | + 'OCA\\Files\\BackgroundJob\\ScanFiles' => $baseDir.'/../lib/BackgroundJob/ScanFiles.php', |
|
| 28 | + 'OCA\\Files\\BackgroundJob\\TransferOwnership' => $baseDir.'/../lib/BackgroundJob/TransferOwnership.php', |
|
| 29 | + 'OCA\\Files\\Capabilities' => $baseDir.'/../lib/Capabilities.php', |
|
| 30 | + 'OCA\\Files\\Collaboration\\Resources\\Listener' => $baseDir.'/../lib/Collaboration/Resources/Listener.php', |
|
| 31 | + 'OCA\\Files\\Collaboration\\Resources\\ResourceProvider' => $baseDir.'/../lib/Collaboration/Resources/ResourceProvider.php', |
|
| 32 | + 'OCA\\Files\\Command\\Copy' => $baseDir.'/../lib/Command/Copy.php', |
|
| 33 | + 'OCA\\Files\\Command\\Delete' => $baseDir.'/../lib/Command/Delete.php', |
|
| 34 | + 'OCA\\Files\\Command\\DeleteOrphanedFiles' => $baseDir.'/../lib/Command/DeleteOrphanedFiles.php', |
|
| 35 | + 'OCA\\Files\\Command\\Get' => $baseDir.'/../lib/Command/Get.php', |
|
| 36 | + 'OCA\\Files\\Command\\Move' => $baseDir.'/../lib/Command/Move.php', |
|
| 37 | + 'OCA\\Files\\Command\\Object\\Delete' => $baseDir.'/../lib/Command/Object/Delete.php', |
|
| 38 | + 'OCA\\Files\\Command\\Object\\Get' => $baseDir.'/../lib/Command/Object/Get.php', |
|
| 39 | + 'OCA\\Files\\Command\\Object\\Info' => $baseDir.'/../lib/Command/Object/Info.php', |
|
| 40 | + 'OCA\\Files\\Command\\Object\\ListObject' => $baseDir.'/../lib/Command/Object/ListObject.php', |
|
| 41 | + 'OCA\\Files\\Command\\Object\\Multi\\Rename' => $baseDir.'/../lib/Command/Object/Multi/Rename.php', |
|
| 42 | + 'OCA\\Files\\Command\\Object\\Multi\\Users' => $baseDir.'/../lib/Command/Object/Multi/Users.php', |
|
| 43 | + 'OCA\\Files\\Command\\Object\\ObjectUtil' => $baseDir.'/../lib/Command/Object/ObjectUtil.php', |
|
| 44 | + 'OCA\\Files\\Command\\Object\\Orphans' => $baseDir.'/../lib/Command/Object/Orphans.php', |
|
| 45 | + 'OCA\\Files\\Command\\Object\\Put' => $baseDir.'/../lib/Command/Object/Put.php', |
|
| 46 | + 'OCA\\Files\\Command\\Put' => $baseDir.'/../lib/Command/Put.php', |
|
| 47 | + 'OCA\\Files\\Command\\RepairTree' => $baseDir.'/../lib/Command/RepairTree.php', |
|
| 48 | + 'OCA\\Files\\Command\\SanitizeFilenames' => $baseDir.'/../lib/Command/SanitizeFilenames.php', |
|
| 49 | + 'OCA\\Files\\Command\\Scan' => $baseDir.'/../lib/Command/Scan.php', |
|
| 50 | + 'OCA\\Files\\Command\\ScanAppData' => $baseDir.'/../lib/Command/ScanAppData.php', |
|
| 51 | + 'OCA\\Files\\Command\\TransferOwnership' => $baseDir.'/../lib/Command/TransferOwnership.php', |
|
| 52 | + 'OCA\\Files\\Command\\WindowsCompatibleFilenames' => $baseDir.'/../lib/Command/WindowsCompatibleFilenames.php', |
|
| 53 | + 'OCA\\Files\\ConfigLexicon' => $baseDir.'/../lib/ConfigLexicon.php', |
|
| 54 | + 'OCA\\Files\\Controller\\ApiController' => $baseDir.'/../lib/Controller/ApiController.php', |
|
| 55 | + 'OCA\\Files\\Controller\\ConversionApiController' => $baseDir.'/../lib/Controller/ConversionApiController.php', |
|
| 56 | + 'OCA\\Files\\Controller\\DirectEditingController' => $baseDir.'/../lib/Controller/DirectEditingController.php', |
|
| 57 | + 'OCA\\Files\\Controller\\DirectEditingViewController' => $baseDir.'/../lib/Controller/DirectEditingViewController.php', |
|
| 58 | + 'OCA\\Files\\Controller\\FilenamesController' => $baseDir.'/../lib/Controller/FilenamesController.php', |
|
| 59 | + 'OCA\\Files\\Controller\\OpenLocalEditorController' => $baseDir.'/../lib/Controller/OpenLocalEditorController.php', |
|
| 60 | + 'OCA\\Files\\Controller\\TemplateController' => $baseDir.'/../lib/Controller/TemplateController.php', |
|
| 61 | + 'OCA\\Files\\Controller\\TransferOwnershipController' => $baseDir.'/../lib/Controller/TransferOwnershipController.php', |
|
| 62 | + 'OCA\\Files\\Controller\\ViewController' => $baseDir.'/../lib/Controller/ViewController.php', |
|
| 63 | + 'OCA\\Files\\Dashboard\\FavoriteWidget' => $baseDir.'/../lib/Dashboard/FavoriteWidget.php', |
|
| 64 | + 'OCA\\Files\\Db\\OpenLocalEditor' => $baseDir.'/../lib/Db/OpenLocalEditor.php', |
|
| 65 | + 'OCA\\Files\\Db\\OpenLocalEditorMapper' => $baseDir.'/../lib/Db/OpenLocalEditorMapper.php', |
|
| 66 | + 'OCA\\Files\\Db\\TransferOwnership' => $baseDir.'/../lib/Db/TransferOwnership.php', |
|
| 67 | + 'OCA\\Files\\Db\\TransferOwnershipMapper' => $baseDir.'/../lib/Db/TransferOwnershipMapper.php', |
|
| 68 | + 'OCA\\Files\\DirectEditingCapabilities' => $baseDir.'/../lib/DirectEditingCapabilities.php', |
|
| 69 | + 'OCA\\Files\\Event\\LoadAdditionalScriptsEvent' => $baseDir.'/../lib/Event/LoadAdditionalScriptsEvent.php', |
|
| 70 | + 'OCA\\Files\\Event\\LoadSearchPlugins' => $baseDir.'/../lib/Event/LoadSearchPlugins.php', |
|
| 71 | + 'OCA\\Files\\Event\\LoadSidebar' => $baseDir.'/../lib/Event/LoadSidebar.php', |
|
| 72 | + 'OCA\\Files\\Exception\\TransferOwnershipException' => $baseDir.'/../lib/Exception/TransferOwnershipException.php', |
|
| 73 | + 'OCA\\Files\\Helper' => $baseDir.'/../lib/Helper.php', |
|
| 74 | + 'OCA\\Files\\Listener\\LoadSearchPluginsListener' => $baseDir.'/../lib/Listener/LoadSearchPluginsListener.php', |
|
| 75 | + 'OCA\\Files\\Listener\\LoadSidebarListener' => $baseDir.'/../lib/Listener/LoadSidebarListener.php', |
|
| 76 | + 'OCA\\Files\\Listener\\NodeAddedToFavoriteListener' => $baseDir.'/../lib/Listener/NodeAddedToFavoriteListener.php', |
|
| 77 | + 'OCA\\Files\\Listener\\NodeRemovedFromFavoriteListener' => $baseDir.'/../lib/Listener/NodeRemovedFromFavoriteListener.php', |
|
| 78 | + 'OCA\\Files\\Listener\\RenderReferenceEventListener' => $baseDir.'/../lib/Listener/RenderReferenceEventListener.php', |
|
| 79 | + 'OCA\\Files\\Listener\\SyncLivePhotosListener' => $baseDir.'/../lib/Listener/SyncLivePhotosListener.php', |
|
| 80 | + 'OCA\\Files\\Migration\\Version11301Date20191205150729' => $baseDir.'/../lib/Migration/Version11301Date20191205150729.php', |
|
| 81 | + 'OCA\\Files\\Migration\\Version12101Date20221011153334' => $baseDir.'/../lib/Migration/Version12101Date20221011153334.php', |
|
| 82 | + 'OCA\\Files\\Migration\\Version2003Date20241021095629' => $baseDir.'/../lib/Migration/Version2003Date20241021095629.php', |
|
| 83 | + 'OCA\\Files\\Notification\\Notifier' => $baseDir.'/../lib/Notification/Notifier.php', |
|
| 84 | + 'OCA\\Files\\ResponseDefinitions' => $baseDir.'/../lib/ResponseDefinitions.php', |
|
| 85 | + 'OCA\\Files\\Search\\FilesSearchProvider' => $baseDir.'/../lib/Search/FilesSearchProvider.php', |
|
| 86 | + 'OCA\\Files\\Service\\ChunkedUploadConfig' => $baseDir.'/../lib/Service/ChunkedUploadConfig.php', |
|
| 87 | + 'OCA\\Files\\Service\\DirectEditingService' => $baseDir.'/../lib/Service/DirectEditingService.php', |
|
| 88 | + 'OCA\\Files\\Service\\LivePhotosService' => $baseDir.'/../lib/Service/LivePhotosService.php', |
|
| 89 | + 'OCA\\Files\\Service\\OwnershipTransferService' => $baseDir.'/../lib/Service/OwnershipTransferService.php', |
|
| 90 | + 'OCA\\Files\\Service\\SettingsService' => $baseDir.'/../lib/Service/SettingsService.php', |
|
| 91 | + 'OCA\\Files\\Service\\TagService' => $baseDir.'/../lib/Service/TagService.php', |
|
| 92 | + 'OCA\\Files\\Service\\UserConfig' => $baseDir.'/../lib/Service/UserConfig.php', |
|
| 93 | + 'OCA\\Files\\Service\\ViewConfig' => $baseDir.'/../lib/Service/ViewConfig.php', |
|
| 94 | + 'OCA\\Files\\Settings\\AdminSettings' => $baseDir.'/../lib/Settings/AdminSettings.php', |
|
| 95 | + 'OCA\\Files\\Settings\\PersonalSettings' => $baseDir.'/../lib/Settings/PersonalSettings.php', |
|
| 96 | 96 | ); |
@@ -6,113 +6,113 @@ |
||
| 6 | 6 | |
| 7 | 7 | class ComposerStaticInitFiles |
| 8 | 8 | { |
| 9 | - public static $prefixLengthsPsr4 = array ( |
|
| 9 | + public static $prefixLengthsPsr4 = array( |
|
| 10 | 10 | 'O' => |
| 11 | - array ( |
|
| 11 | + array( |
|
| 12 | 12 | 'OCA\\Files\\' => 10, |
| 13 | 13 | ), |
| 14 | 14 | ); |
| 15 | 15 | |
| 16 | - public static $prefixDirsPsr4 = array ( |
|
| 16 | + public static $prefixDirsPsr4 = array( |
|
| 17 | 17 | 'OCA\\Files\\' => |
| 18 | - array ( |
|
| 19 | - 0 => __DIR__ . '/..' . '/../lib', |
|
| 18 | + array( |
|
| 19 | + 0 => __DIR__.'/..'.'/../lib', |
|
| 20 | 20 | ), |
| 21 | 21 | ); |
| 22 | 22 | |
| 23 | - public static $classMap = array ( |
|
| 24 | - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', |
|
| 25 | - 'OCA\\Files\\Activity\\FavoriteProvider' => __DIR__ . '/..' . '/../lib/Activity/FavoriteProvider.php', |
|
| 26 | - 'OCA\\Files\\Activity\\Filter\\Favorites' => __DIR__ . '/..' . '/../lib/Activity/Filter/Favorites.php', |
|
| 27 | - 'OCA\\Files\\Activity\\Filter\\FileChanges' => __DIR__ . '/..' . '/../lib/Activity/Filter/FileChanges.php', |
|
| 28 | - 'OCA\\Files\\Activity\\Helper' => __DIR__ . '/..' . '/../lib/Activity/Helper.php', |
|
| 29 | - 'OCA\\Files\\Activity\\Provider' => __DIR__ . '/..' . '/../lib/Activity/Provider.php', |
|
| 30 | - 'OCA\\Files\\Activity\\Settings\\FavoriteAction' => __DIR__ . '/..' . '/../lib/Activity/Settings/FavoriteAction.php', |
|
| 31 | - 'OCA\\Files\\Activity\\Settings\\FileActivitySettings' => __DIR__ . '/..' . '/../lib/Activity/Settings/FileActivitySettings.php', |
|
| 32 | - 'OCA\\Files\\Activity\\Settings\\FileChanged' => __DIR__ . '/..' . '/../lib/Activity/Settings/FileChanged.php', |
|
| 33 | - 'OCA\\Files\\Activity\\Settings\\FileFavoriteChanged' => __DIR__ . '/..' . '/../lib/Activity/Settings/FileFavoriteChanged.php', |
|
| 34 | - 'OCA\\Files\\AdvancedCapabilities' => __DIR__ . '/..' . '/../lib/AdvancedCapabilities.php', |
|
| 35 | - 'OCA\\Files\\App' => __DIR__ . '/..' . '/../lib/App.php', |
|
| 36 | - 'OCA\\Files\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php', |
|
| 37 | - 'OCA\\Files\\BackgroundJob\\CleanupDirectEditingTokens' => __DIR__ . '/..' . '/../lib/BackgroundJob/CleanupDirectEditingTokens.php', |
|
| 38 | - 'OCA\\Files\\BackgroundJob\\CleanupFileLocks' => __DIR__ . '/..' . '/../lib/BackgroundJob/CleanupFileLocks.php', |
|
| 39 | - 'OCA\\Files\\BackgroundJob\\DeleteExpiredOpenLocalEditor' => __DIR__ . '/..' . '/../lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php', |
|
| 40 | - 'OCA\\Files\\BackgroundJob\\DeleteOrphanedItems' => __DIR__ . '/..' . '/../lib/BackgroundJob/DeleteOrphanedItems.php', |
|
| 41 | - 'OCA\\Files\\BackgroundJob\\SanitizeFilenames' => __DIR__ . '/..' . '/../lib/BackgroundJob/SanitizeFilenames.php', |
|
| 42 | - 'OCA\\Files\\BackgroundJob\\ScanFiles' => __DIR__ . '/..' . '/../lib/BackgroundJob/ScanFiles.php', |
|
| 43 | - 'OCA\\Files\\BackgroundJob\\TransferOwnership' => __DIR__ . '/..' . '/../lib/BackgroundJob/TransferOwnership.php', |
|
| 44 | - 'OCA\\Files\\Capabilities' => __DIR__ . '/..' . '/../lib/Capabilities.php', |
|
| 45 | - 'OCA\\Files\\Collaboration\\Resources\\Listener' => __DIR__ . '/..' . '/../lib/Collaboration/Resources/Listener.php', |
|
| 46 | - 'OCA\\Files\\Collaboration\\Resources\\ResourceProvider' => __DIR__ . '/..' . '/../lib/Collaboration/Resources/ResourceProvider.php', |
|
| 47 | - 'OCA\\Files\\Command\\Copy' => __DIR__ . '/..' . '/../lib/Command/Copy.php', |
|
| 48 | - 'OCA\\Files\\Command\\Delete' => __DIR__ . '/..' . '/../lib/Command/Delete.php', |
|
| 49 | - 'OCA\\Files\\Command\\DeleteOrphanedFiles' => __DIR__ . '/..' . '/../lib/Command/DeleteOrphanedFiles.php', |
|
| 50 | - 'OCA\\Files\\Command\\Get' => __DIR__ . '/..' . '/../lib/Command/Get.php', |
|
| 51 | - 'OCA\\Files\\Command\\Move' => __DIR__ . '/..' . '/../lib/Command/Move.php', |
|
| 52 | - 'OCA\\Files\\Command\\Object\\Delete' => __DIR__ . '/..' . '/../lib/Command/Object/Delete.php', |
|
| 53 | - 'OCA\\Files\\Command\\Object\\Get' => __DIR__ . '/..' . '/../lib/Command/Object/Get.php', |
|
| 54 | - 'OCA\\Files\\Command\\Object\\Info' => __DIR__ . '/..' . '/../lib/Command/Object/Info.php', |
|
| 55 | - 'OCA\\Files\\Command\\Object\\ListObject' => __DIR__ . '/..' . '/../lib/Command/Object/ListObject.php', |
|
| 56 | - 'OCA\\Files\\Command\\Object\\Multi\\Rename' => __DIR__ . '/..' . '/../lib/Command/Object/Multi/Rename.php', |
|
| 57 | - 'OCA\\Files\\Command\\Object\\Multi\\Users' => __DIR__ . '/..' . '/../lib/Command/Object/Multi/Users.php', |
|
| 58 | - 'OCA\\Files\\Command\\Object\\ObjectUtil' => __DIR__ . '/..' . '/../lib/Command/Object/ObjectUtil.php', |
|
| 59 | - 'OCA\\Files\\Command\\Object\\Orphans' => __DIR__ . '/..' . '/../lib/Command/Object/Orphans.php', |
|
| 60 | - 'OCA\\Files\\Command\\Object\\Put' => __DIR__ . '/..' . '/../lib/Command/Object/Put.php', |
|
| 61 | - 'OCA\\Files\\Command\\Put' => __DIR__ . '/..' . '/../lib/Command/Put.php', |
|
| 62 | - 'OCA\\Files\\Command\\RepairTree' => __DIR__ . '/..' . '/../lib/Command/RepairTree.php', |
|
| 63 | - 'OCA\\Files\\Command\\SanitizeFilenames' => __DIR__ . '/..' . '/../lib/Command/SanitizeFilenames.php', |
|
| 64 | - 'OCA\\Files\\Command\\Scan' => __DIR__ . '/..' . '/../lib/Command/Scan.php', |
|
| 65 | - 'OCA\\Files\\Command\\ScanAppData' => __DIR__ . '/..' . '/../lib/Command/ScanAppData.php', |
|
| 66 | - 'OCA\\Files\\Command\\TransferOwnership' => __DIR__ . '/..' . '/../lib/Command/TransferOwnership.php', |
|
| 67 | - 'OCA\\Files\\Command\\WindowsCompatibleFilenames' => __DIR__ . '/..' . '/../lib/Command/WindowsCompatibleFilenames.php', |
|
| 68 | - 'OCA\\Files\\ConfigLexicon' => __DIR__ . '/..' . '/../lib/ConfigLexicon.php', |
|
| 69 | - 'OCA\\Files\\Controller\\ApiController' => __DIR__ . '/..' . '/../lib/Controller/ApiController.php', |
|
| 70 | - 'OCA\\Files\\Controller\\ConversionApiController' => __DIR__ . '/..' . '/../lib/Controller/ConversionApiController.php', |
|
| 71 | - 'OCA\\Files\\Controller\\DirectEditingController' => __DIR__ . '/..' . '/../lib/Controller/DirectEditingController.php', |
|
| 72 | - 'OCA\\Files\\Controller\\DirectEditingViewController' => __DIR__ . '/..' . '/../lib/Controller/DirectEditingViewController.php', |
|
| 73 | - 'OCA\\Files\\Controller\\FilenamesController' => __DIR__ . '/..' . '/../lib/Controller/FilenamesController.php', |
|
| 74 | - 'OCA\\Files\\Controller\\OpenLocalEditorController' => __DIR__ . '/..' . '/../lib/Controller/OpenLocalEditorController.php', |
|
| 75 | - 'OCA\\Files\\Controller\\TemplateController' => __DIR__ . '/..' . '/../lib/Controller/TemplateController.php', |
|
| 76 | - 'OCA\\Files\\Controller\\TransferOwnershipController' => __DIR__ . '/..' . '/../lib/Controller/TransferOwnershipController.php', |
|
| 77 | - 'OCA\\Files\\Controller\\ViewController' => __DIR__ . '/..' . '/../lib/Controller/ViewController.php', |
|
| 78 | - 'OCA\\Files\\Dashboard\\FavoriteWidget' => __DIR__ . '/..' . '/../lib/Dashboard/FavoriteWidget.php', |
|
| 79 | - 'OCA\\Files\\Db\\OpenLocalEditor' => __DIR__ . '/..' . '/../lib/Db/OpenLocalEditor.php', |
|
| 80 | - 'OCA\\Files\\Db\\OpenLocalEditorMapper' => __DIR__ . '/..' . '/../lib/Db/OpenLocalEditorMapper.php', |
|
| 81 | - 'OCA\\Files\\Db\\TransferOwnership' => __DIR__ . '/..' . '/../lib/Db/TransferOwnership.php', |
|
| 82 | - 'OCA\\Files\\Db\\TransferOwnershipMapper' => __DIR__ . '/..' . '/../lib/Db/TransferOwnershipMapper.php', |
|
| 83 | - 'OCA\\Files\\DirectEditingCapabilities' => __DIR__ . '/..' . '/../lib/DirectEditingCapabilities.php', |
|
| 84 | - 'OCA\\Files\\Event\\LoadAdditionalScriptsEvent' => __DIR__ . '/..' . '/../lib/Event/LoadAdditionalScriptsEvent.php', |
|
| 85 | - 'OCA\\Files\\Event\\LoadSearchPlugins' => __DIR__ . '/..' . '/../lib/Event/LoadSearchPlugins.php', |
|
| 86 | - 'OCA\\Files\\Event\\LoadSidebar' => __DIR__ . '/..' . '/../lib/Event/LoadSidebar.php', |
|
| 87 | - 'OCA\\Files\\Exception\\TransferOwnershipException' => __DIR__ . '/..' . '/../lib/Exception/TransferOwnershipException.php', |
|
| 88 | - 'OCA\\Files\\Helper' => __DIR__ . '/..' . '/../lib/Helper.php', |
|
| 89 | - 'OCA\\Files\\Listener\\LoadSearchPluginsListener' => __DIR__ . '/..' . '/../lib/Listener/LoadSearchPluginsListener.php', |
|
| 90 | - 'OCA\\Files\\Listener\\LoadSidebarListener' => __DIR__ . '/..' . '/../lib/Listener/LoadSidebarListener.php', |
|
| 91 | - 'OCA\\Files\\Listener\\NodeAddedToFavoriteListener' => __DIR__ . '/..' . '/../lib/Listener/NodeAddedToFavoriteListener.php', |
|
| 92 | - 'OCA\\Files\\Listener\\NodeRemovedFromFavoriteListener' => __DIR__ . '/..' . '/../lib/Listener/NodeRemovedFromFavoriteListener.php', |
|
| 93 | - 'OCA\\Files\\Listener\\RenderReferenceEventListener' => __DIR__ . '/..' . '/../lib/Listener/RenderReferenceEventListener.php', |
|
| 94 | - 'OCA\\Files\\Listener\\SyncLivePhotosListener' => __DIR__ . '/..' . '/../lib/Listener/SyncLivePhotosListener.php', |
|
| 95 | - 'OCA\\Files\\Migration\\Version11301Date20191205150729' => __DIR__ . '/..' . '/../lib/Migration/Version11301Date20191205150729.php', |
|
| 96 | - 'OCA\\Files\\Migration\\Version12101Date20221011153334' => __DIR__ . '/..' . '/../lib/Migration/Version12101Date20221011153334.php', |
|
| 97 | - 'OCA\\Files\\Migration\\Version2003Date20241021095629' => __DIR__ . '/..' . '/../lib/Migration/Version2003Date20241021095629.php', |
|
| 98 | - 'OCA\\Files\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php', |
|
| 99 | - 'OCA\\Files\\ResponseDefinitions' => __DIR__ . '/..' . '/../lib/ResponseDefinitions.php', |
|
| 100 | - 'OCA\\Files\\Search\\FilesSearchProvider' => __DIR__ . '/..' . '/../lib/Search/FilesSearchProvider.php', |
|
| 101 | - 'OCA\\Files\\Service\\ChunkedUploadConfig' => __DIR__ . '/..' . '/../lib/Service/ChunkedUploadConfig.php', |
|
| 102 | - 'OCA\\Files\\Service\\DirectEditingService' => __DIR__ . '/..' . '/../lib/Service/DirectEditingService.php', |
|
| 103 | - 'OCA\\Files\\Service\\LivePhotosService' => __DIR__ . '/..' . '/../lib/Service/LivePhotosService.php', |
|
| 104 | - 'OCA\\Files\\Service\\OwnershipTransferService' => __DIR__ . '/..' . '/../lib/Service/OwnershipTransferService.php', |
|
| 105 | - 'OCA\\Files\\Service\\SettingsService' => __DIR__ . '/..' . '/../lib/Service/SettingsService.php', |
|
| 106 | - 'OCA\\Files\\Service\\TagService' => __DIR__ . '/..' . '/../lib/Service/TagService.php', |
|
| 107 | - 'OCA\\Files\\Service\\UserConfig' => __DIR__ . '/..' . '/../lib/Service/UserConfig.php', |
|
| 108 | - 'OCA\\Files\\Service\\ViewConfig' => __DIR__ . '/..' . '/../lib/Service/ViewConfig.php', |
|
| 109 | - 'OCA\\Files\\Settings\\AdminSettings' => __DIR__ . '/..' . '/../lib/Settings/AdminSettings.php', |
|
| 110 | - 'OCA\\Files\\Settings\\PersonalSettings' => __DIR__ . '/..' . '/../lib/Settings/PersonalSettings.php', |
|
| 23 | + public static $classMap = array( |
|
| 24 | + 'Composer\\InstalledVersions' => __DIR__.'/..'.'/composer/InstalledVersions.php', |
|
| 25 | + 'OCA\\Files\\Activity\\FavoriteProvider' => __DIR__.'/..'.'/../lib/Activity/FavoriteProvider.php', |
|
| 26 | + 'OCA\\Files\\Activity\\Filter\\Favorites' => __DIR__.'/..'.'/../lib/Activity/Filter/Favorites.php', |
|
| 27 | + 'OCA\\Files\\Activity\\Filter\\FileChanges' => __DIR__.'/..'.'/../lib/Activity/Filter/FileChanges.php', |
|
| 28 | + 'OCA\\Files\\Activity\\Helper' => __DIR__.'/..'.'/../lib/Activity/Helper.php', |
|
| 29 | + 'OCA\\Files\\Activity\\Provider' => __DIR__.'/..'.'/../lib/Activity/Provider.php', |
|
| 30 | + 'OCA\\Files\\Activity\\Settings\\FavoriteAction' => __DIR__.'/..'.'/../lib/Activity/Settings/FavoriteAction.php', |
|
| 31 | + 'OCA\\Files\\Activity\\Settings\\FileActivitySettings' => __DIR__.'/..'.'/../lib/Activity/Settings/FileActivitySettings.php', |
|
| 32 | + 'OCA\\Files\\Activity\\Settings\\FileChanged' => __DIR__.'/..'.'/../lib/Activity/Settings/FileChanged.php', |
|
| 33 | + 'OCA\\Files\\Activity\\Settings\\FileFavoriteChanged' => __DIR__.'/..'.'/../lib/Activity/Settings/FileFavoriteChanged.php', |
|
| 34 | + 'OCA\\Files\\AdvancedCapabilities' => __DIR__.'/..'.'/../lib/AdvancedCapabilities.php', |
|
| 35 | + 'OCA\\Files\\App' => __DIR__.'/..'.'/../lib/App.php', |
|
| 36 | + 'OCA\\Files\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php', |
|
| 37 | + 'OCA\\Files\\BackgroundJob\\CleanupDirectEditingTokens' => __DIR__.'/..'.'/../lib/BackgroundJob/CleanupDirectEditingTokens.php', |
|
| 38 | + 'OCA\\Files\\BackgroundJob\\CleanupFileLocks' => __DIR__.'/..'.'/../lib/BackgroundJob/CleanupFileLocks.php', |
|
| 39 | + 'OCA\\Files\\BackgroundJob\\DeleteExpiredOpenLocalEditor' => __DIR__.'/..'.'/../lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php', |
|
| 40 | + 'OCA\\Files\\BackgroundJob\\DeleteOrphanedItems' => __DIR__.'/..'.'/../lib/BackgroundJob/DeleteOrphanedItems.php', |
|
| 41 | + 'OCA\\Files\\BackgroundJob\\SanitizeFilenames' => __DIR__.'/..'.'/../lib/BackgroundJob/SanitizeFilenames.php', |
|
| 42 | + 'OCA\\Files\\BackgroundJob\\ScanFiles' => __DIR__.'/..'.'/../lib/BackgroundJob/ScanFiles.php', |
|
| 43 | + 'OCA\\Files\\BackgroundJob\\TransferOwnership' => __DIR__.'/..'.'/../lib/BackgroundJob/TransferOwnership.php', |
|
| 44 | + 'OCA\\Files\\Capabilities' => __DIR__.'/..'.'/../lib/Capabilities.php', |
|
| 45 | + 'OCA\\Files\\Collaboration\\Resources\\Listener' => __DIR__.'/..'.'/../lib/Collaboration/Resources/Listener.php', |
|
| 46 | + 'OCA\\Files\\Collaboration\\Resources\\ResourceProvider' => __DIR__.'/..'.'/../lib/Collaboration/Resources/ResourceProvider.php', |
|
| 47 | + 'OCA\\Files\\Command\\Copy' => __DIR__.'/..'.'/../lib/Command/Copy.php', |
|
| 48 | + 'OCA\\Files\\Command\\Delete' => __DIR__.'/..'.'/../lib/Command/Delete.php', |
|
| 49 | + 'OCA\\Files\\Command\\DeleteOrphanedFiles' => __DIR__.'/..'.'/../lib/Command/DeleteOrphanedFiles.php', |
|
| 50 | + 'OCA\\Files\\Command\\Get' => __DIR__.'/..'.'/../lib/Command/Get.php', |
|
| 51 | + 'OCA\\Files\\Command\\Move' => __DIR__.'/..'.'/../lib/Command/Move.php', |
|
| 52 | + 'OCA\\Files\\Command\\Object\\Delete' => __DIR__.'/..'.'/../lib/Command/Object/Delete.php', |
|
| 53 | + 'OCA\\Files\\Command\\Object\\Get' => __DIR__.'/..'.'/../lib/Command/Object/Get.php', |
|
| 54 | + 'OCA\\Files\\Command\\Object\\Info' => __DIR__.'/..'.'/../lib/Command/Object/Info.php', |
|
| 55 | + 'OCA\\Files\\Command\\Object\\ListObject' => __DIR__.'/..'.'/../lib/Command/Object/ListObject.php', |
|
| 56 | + 'OCA\\Files\\Command\\Object\\Multi\\Rename' => __DIR__.'/..'.'/../lib/Command/Object/Multi/Rename.php', |
|
| 57 | + 'OCA\\Files\\Command\\Object\\Multi\\Users' => __DIR__.'/..'.'/../lib/Command/Object/Multi/Users.php', |
|
| 58 | + 'OCA\\Files\\Command\\Object\\ObjectUtil' => __DIR__.'/..'.'/../lib/Command/Object/ObjectUtil.php', |
|
| 59 | + 'OCA\\Files\\Command\\Object\\Orphans' => __DIR__.'/..'.'/../lib/Command/Object/Orphans.php', |
|
| 60 | + 'OCA\\Files\\Command\\Object\\Put' => __DIR__.'/..'.'/../lib/Command/Object/Put.php', |
|
| 61 | + 'OCA\\Files\\Command\\Put' => __DIR__.'/..'.'/../lib/Command/Put.php', |
|
| 62 | + 'OCA\\Files\\Command\\RepairTree' => __DIR__.'/..'.'/../lib/Command/RepairTree.php', |
|
| 63 | + 'OCA\\Files\\Command\\SanitizeFilenames' => __DIR__.'/..'.'/../lib/Command/SanitizeFilenames.php', |
|
| 64 | + 'OCA\\Files\\Command\\Scan' => __DIR__.'/..'.'/../lib/Command/Scan.php', |
|
| 65 | + 'OCA\\Files\\Command\\ScanAppData' => __DIR__.'/..'.'/../lib/Command/ScanAppData.php', |
|
| 66 | + 'OCA\\Files\\Command\\TransferOwnership' => __DIR__.'/..'.'/../lib/Command/TransferOwnership.php', |
|
| 67 | + 'OCA\\Files\\Command\\WindowsCompatibleFilenames' => __DIR__.'/..'.'/../lib/Command/WindowsCompatibleFilenames.php', |
|
| 68 | + 'OCA\\Files\\ConfigLexicon' => __DIR__.'/..'.'/../lib/ConfigLexicon.php', |
|
| 69 | + 'OCA\\Files\\Controller\\ApiController' => __DIR__.'/..'.'/../lib/Controller/ApiController.php', |
|
| 70 | + 'OCA\\Files\\Controller\\ConversionApiController' => __DIR__.'/..'.'/../lib/Controller/ConversionApiController.php', |
|
| 71 | + 'OCA\\Files\\Controller\\DirectEditingController' => __DIR__.'/..'.'/../lib/Controller/DirectEditingController.php', |
|
| 72 | + 'OCA\\Files\\Controller\\DirectEditingViewController' => __DIR__.'/..'.'/../lib/Controller/DirectEditingViewController.php', |
|
| 73 | + 'OCA\\Files\\Controller\\FilenamesController' => __DIR__.'/..'.'/../lib/Controller/FilenamesController.php', |
|
| 74 | + 'OCA\\Files\\Controller\\OpenLocalEditorController' => __DIR__.'/..'.'/../lib/Controller/OpenLocalEditorController.php', |
|
| 75 | + 'OCA\\Files\\Controller\\TemplateController' => __DIR__.'/..'.'/../lib/Controller/TemplateController.php', |
|
| 76 | + 'OCA\\Files\\Controller\\TransferOwnershipController' => __DIR__.'/..'.'/../lib/Controller/TransferOwnershipController.php', |
|
| 77 | + 'OCA\\Files\\Controller\\ViewController' => __DIR__.'/..'.'/../lib/Controller/ViewController.php', |
|
| 78 | + 'OCA\\Files\\Dashboard\\FavoriteWidget' => __DIR__.'/..'.'/../lib/Dashboard/FavoriteWidget.php', |
|
| 79 | + 'OCA\\Files\\Db\\OpenLocalEditor' => __DIR__.'/..'.'/../lib/Db/OpenLocalEditor.php', |
|
| 80 | + 'OCA\\Files\\Db\\OpenLocalEditorMapper' => __DIR__.'/..'.'/../lib/Db/OpenLocalEditorMapper.php', |
|
| 81 | + 'OCA\\Files\\Db\\TransferOwnership' => __DIR__.'/..'.'/../lib/Db/TransferOwnership.php', |
|
| 82 | + 'OCA\\Files\\Db\\TransferOwnershipMapper' => __DIR__.'/..'.'/../lib/Db/TransferOwnershipMapper.php', |
|
| 83 | + 'OCA\\Files\\DirectEditingCapabilities' => __DIR__.'/..'.'/../lib/DirectEditingCapabilities.php', |
|
| 84 | + 'OCA\\Files\\Event\\LoadAdditionalScriptsEvent' => __DIR__.'/..'.'/../lib/Event/LoadAdditionalScriptsEvent.php', |
|
| 85 | + 'OCA\\Files\\Event\\LoadSearchPlugins' => __DIR__.'/..'.'/../lib/Event/LoadSearchPlugins.php', |
|
| 86 | + 'OCA\\Files\\Event\\LoadSidebar' => __DIR__.'/..'.'/../lib/Event/LoadSidebar.php', |
|
| 87 | + 'OCA\\Files\\Exception\\TransferOwnershipException' => __DIR__.'/..'.'/../lib/Exception/TransferOwnershipException.php', |
|
| 88 | + 'OCA\\Files\\Helper' => __DIR__.'/..'.'/../lib/Helper.php', |
|
| 89 | + 'OCA\\Files\\Listener\\LoadSearchPluginsListener' => __DIR__.'/..'.'/../lib/Listener/LoadSearchPluginsListener.php', |
|
| 90 | + 'OCA\\Files\\Listener\\LoadSidebarListener' => __DIR__.'/..'.'/../lib/Listener/LoadSidebarListener.php', |
|
| 91 | + 'OCA\\Files\\Listener\\NodeAddedToFavoriteListener' => __DIR__.'/..'.'/../lib/Listener/NodeAddedToFavoriteListener.php', |
|
| 92 | + 'OCA\\Files\\Listener\\NodeRemovedFromFavoriteListener' => __DIR__.'/..'.'/../lib/Listener/NodeRemovedFromFavoriteListener.php', |
|
| 93 | + 'OCA\\Files\\Listener\\RenderReferenceEventListener' => __DIR__.'/..'.'/../lib/Listener/RenderReferenceEventListener.php', |
|
| 94 | + 'OCA\\Files\\Listener\\SyncLivePhotosListener' => __DIR__.'/..'.'/../lib/Listener/SyncLivePhotosListener.php', |
|
| 95 | + 'OCA\\Files\\Migration\\Version11301Date20191205150729' => __DIR__.'/..'.'/../lib/Migration/Version11301Date20191205150729.php', |
|
| 96 | + 'OCA\\Files\\Migration\\Version12101Date20221011153334' => __DIR__.'/..'.'/../lib/Migration/Version12101Date20221011153334.php', |
|
| 97 | + 'OCA\\Files\\Migration\\Version2003Date20241021095629' => __DIR__.'/..'.'/../lib/Migration/Version2003Date20241021095629.php', |
|
| 98 | + 'OCA\\Files\\Notification\\Notifier' => __DIR__.'/..'.'/../lib/Notification/Notifier.php', |
|
| 99 | + 'OCA\\Files\\ResponseDefinitions' => __DIR__.'/..'.'/../lib/ResponseDefinitions.php', |
|
| 100 | + 'OCA\\Files\\Search\\FilesSearchProvider' => __DIR__.'/..'.'/../lib/Search/FilesSearchProvider.php', |
|
| 101 | + 'OCA\\Files\\Service\\ChunkedUploadConfig' => __DIR__.'/..'.'/../lib/Service/ChunkedUploadConfig.php', |
|
| 102 | + 'OCA\\Files\\Service\\DirectEditingService' => __DIR__.'/..'.'/../lib/Service/DirectEditingService.php', |
|
| 103 | + 'OCA\\Files\\Service\\LivePhotosService' => __DIR__.'/..'.'/../lib/Service/LivePhotosService.php', |
|
| 104 | + 'OCA\\Files\\Service\\OwnershipTransferService' => __DIR__.'/..'.'/../lib/Service/OwnershipTransferService.php', |
|
| 105 | + 'OCA\\Files\\Service\\SettingsService' => __DIR__.'/..'.'/../lib/Service/SettingsService.php', |
|
| 106 | + 'OCA\\Files\\Service\\TagService' => __DIR__.'/..'.'/../lib/Service/TagService.php', |
|
| 107 | + 'OCA\\Files\\Service\\UserConfig' => __DIR__.'/..'.'/../lib/Service/UserConfig.php', |
|
| 108 | + 'OCA\\Files\\Service\\ViewConfig' => __DIR__.'/..'.'/../lib/Service/ViewConfig.php', |
|
| 109 | + 'OCA\\Files\\Settings\\AdminSettings' => __DIR__.'/..'.'/../lib/Settings/AdminSettings.php', |
|
| 110 | + 'OCA\\Files\\Settings\\PersonalSettings' => __DIR__.'/..'.'/../lib/Settings/PersonalSettings.php', |
|
| 111 | 111 | ); |
| 112 | 112 | |
| 113 | 113 | public static function getInitializer(ClassLoader $loader) |
| 114 | 114 | { |
| 115 | - return \Closure::bind(function () use ($loader) { |
|
| 115 | + return \Closure::bind(function() use ($loader) { |
|
| 116 | 116 | $loader->prefixLengthsPsr4 = ComposerStaticInitFiles::$prefixLengthsPsr4; |
| 117 | 117 | $loader->prefixDirsPsr4 = ComposerStaticInitFiles::$prefixDirsPsr4; |
| 118 | 118 | $loader->classMap = ComposerStaticInitFiles::$classMap; |
@@ -47,998 +47,998 @@ |
||
| 47 | 47 | * @package Test\Files\Node |
| 48 | 48 | */ |
| 49 | 49 | class FolderTest extends NodeTestCase { |
| 50 | - protected function createTestNode($root, $view, $path, array $data = [], $internalPath = '', $storage = null) { |
|
| 51 | - $view->expects($this->any()) |
|
| 52 | - ->method('getRoot') |
|
| 53 | - ->willReturn(''); |
|
| 54 | - if ($data || $internalPath || $storage) { |
|
| 55 | - return new Folder($root, $view, $path, $this->getFileInfo($data, $internalPath, $storage)); |
|
| 56 | - } else { |
|
| 57 | - return new Folder($root, $view, $path); |
|
| 58 | - } |
|
| 59 | - } |
|
| 60 | - |
|
| 61 | - protected function getNodeClass() { |
|
| 62 | - return '\OC\Files\Node\Folder'; |
|
| 63 | - } |
|
| 64 | - |
|
| 65 | - protected function getNonExistingNodeClass() { |
|
| 66 | - return '\OC\Files\Node\NonExistingFolder'; |
|
| 67 | - } |
|
| 68 | - |
|
| 69 | - protected function getViewDeleteMethod() { |
|
| 70 | - return 'rmdir'; |
|
| 71 | - } |
|
| 72 | - |
|
| 73 | - public function testGetDirectoryContent(): void { |
|
| 74 | - $manager = $this->createMock(Manager::class); |
|
| 75 | - /** |
|
| 76 | - * @var View|\PHPUnit\Framework\MockObject\MockObject $view |
|
| 77 | - */ |
|
| 78 | - $root = $this->getMockBuilder(Root::class) |
|
| 79 | - ->setConstructorArgs([$manager, $this->view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 80 | - ->getMock(); |
|
| 81 | - $root->expects($this->any()) |
|
| 82 | - ->method('getUser') |
|
| 83 | - ->willReturn($this->user); |
|
| 84 | - |
|
| 85 | - $this->view->expects($this->any()) |
|
| 86 | - ->method('getDirectoryContent') |
|
| 87 | - ->with('/bar/foo') |
|
| 88 | - ->willReturn([ |
|
| 89 | - new FileInfo('/bar/foo/asd', null, 'foo/asd', ['fileid' => 2, 'path' => '/bar/foo/asd', 'name' => 'asd', 'size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain'], null), |
|
| 90 | - new FileInfo('/bar/foo/qwerty', null, 'foo/qwerty', ['fileid' => 3, 'path' => '/bar/foo/qwerty', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'httpd/unix-directory'], null), |
|
| 91 | - ]); |
|
| 92 | - $this->view->method('getFileInfo') |
|
| 93 | - ->willReturn($this->createMock(FileInfo::class)); |
|
| 94 | - $this->view->method('getRelativePath') |
|
| 95 | - ->willReturn('/bar/foo'); |
|
| 96 | - |
|
| 97 | - $node = new Folder($root, $this->view, '/bar/foo'); |
|
| 98 | - $children = $node->getDirectoryListing(); |
|
| 99 | - $this->assertEquals(2, count($children)); |
|
| 100 | - $this->assertInstanceOf('\OC\Files\Node\File', $children[0]); |
|
| 101 | - $this->assertInstanceOf('\OC\Files\Node\Folder', $children[1]); |
|
| 102 | - $this->assertEquals('asd', $children[0]->getName()); |
|
| 103 | - $this->assertEquals('qwerty', $children[1]->getName()); |
|
| 104 | - $this->assertEquals(2, $children[0]->getId()); |
|
| 105 | - $this->assertEquals(3, $children[1]->getId()); |
|
| 106 | - } |
|
| 107 | - |
|
| 108 | - public function testGet(): void { |
|
| 109 | - $manager = $this->createMock(Manager::class); |
|
| 110 | - $view = $this->getRootViewMock(); |
|
| 111 | - $root = $this->getMockBuilder(Root::class) |
|
| 112 | - ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 113 | - ->getMock(); |
|
| 114 | - $root->expects($this->any()) |
|
| 115 | - ->method('getUser') |
|
| 116 | - ->willReturn($this->user); |
|
| 117 | - |
|
| 118 | - $node = new File($root, $view, '/bar/foo/asd'); |
|
| 119 | - $root->method('get') |
|
| 120 | - ->with('/bar/foo/asd') |
|
| 121 | - ->willReturn($node); |
|
| 122 | - |
|
| 123 | - $parentNode = new Folder($root, $view, '/bar/foo'); |
|
| 124 | - self::assertEquals($node, $parentNode->get('asd')); |
|
| 125 | - } |
|
| 126 | - |
|
| 127 | - public function testNodeExists(): void { |
|
| 128 | - $manager = $this->createMock(Manager::class); |
|
| 129 | - $view = $this->getRootViewMock(); |
|
| 130 | - $root = $this->getMockBuilder(Root::class) |
|
| 131 | - ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 132 | - ->getMock(); |
|
| 133 | - $root->expects($this->any()) |
|
| 134 | - ->method('getUser') |
|
| 135 | - ->willReturn($this->user); |
|
| 136 | - |
|
| 137 | - $child = new Folder($root, $view, '/bar/foo/asd'); |
|
| 138 | - |
|
| 139 | - $root->method('get') |
|
| 140 | - ->with('/bar/foo/asd') |
|
| 141 | - ->willReturn($child); |
|
| 142 | - |
|
| 143 | - $node = new Folder($root, $view, '/bar/foo'); |
|
| 144 | - $this->assertTrue($node->nodeExists('asd')); |
|
| 145 | - } |
|
| 146 | - |
|
| 147 | - public function testNodeExistsNotExists(): void { |
|
| 148 | - $manager = $this->createMock(Manager::class); |
|
| 149 | - $view = $this->getRootViewMock(); |
|
| 150 | - $root = $this->getMockBuilder(Root::class) |
|
| 151 | - ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 152 | - ->getMock(); |
|
| 153 | - $root->expects($this->any()) |
|
| 154 | - ->method('getUser') |
|
| 155 | - ->willReturn($this->user); |
|
| 156 | - |
|
| 157 | - $root->method('get') |
|
| 158 | - ->with('/bar/foo/asd') |
|
| 159 | - ->willThrowException(new NotFoundException()); |
|
| 160 | - |
|
| 161 | - $node = new Folder($root, $view, '/bar/foo'); |
|
| 162 | - $this->assertFalse($node->nodeExists('asd')); |
|
| 163 | - } |
|
| 164 | - |
|
| 165 | - public function testNewFolder(): void { |
|
| 166 | - $manager = $this->createMock(Manager::class); |
|
| 167 | - $view = $this->getRootViewMock(); |
|
| 168 | - $root = $this->getMockBuilder(Root::class) |
|
| 169 | - ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 170 | - ->getMock(); |
|
| 171 | - $root->expects($this->any()) |
|
| 172 | - ->method('getUser') |
|
| 173 | - ->willReturn($this->user); |
|
| 174 | - |
|
| 175 | - $view->method('getFileInfo') |
|
| 176 | - ->with('/bar/foo') |
|
| 177 | - ->willReturn($this->getFileInfo(['permissions' => Constants::PERMISSION_ALL])); |
|
| 178 | - |
|
| 179 | - $view->method('mkdir') |
|
| 180 | - ->with('/bar/foo/asd') |
|
| 181 | - ->willReturn(true); |
|
| 182 | - |
|
| 183 | - $node = new Folder($root, $view, '/bar/foo'); |
|
| 184 | - $child = new Folder($root, $view, '/bar/foo/asd', null, $node); |
|
| 185 | - $result = $node->newFolder('asd'); |
|
| 186 | - $this->assertEquals($child, $result); |
|
| 187 | - } |
|
| 188 | - |
|
| 189 | - public function testNewFolderDeepParent(): void { |
|
| 190 | - $manager = $this->createMock(Manager::class); |
|
| 191 | - $view = $this->getRootViewMock(); |
|
| 192 | - $root = $this->getMockBuilder(Root::class) |
|
| 193 | - ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 194 | - ->getMock(); |
|
| 195 | - $root->expects($this->any()) |
|
| 196 | - ->method('getUser') |
|
| 197 | - ->willReturn($this->user); |
|
| 198 | - |
|
| 199 | - $view->method('getFileInfo') |
|
| 200 | - ->with('/foobar') |
|
| 201 | - ->willReturn($this->getFileInfo(['permissions' => Constants::PERMISSION_ALL])); |
|
| 202 | - |
|
| 203 | - $view->method('mkdir') |
|
| 204 | - ->with('/foobar/asd/sdf') |
|
| 205 | - ->willReturn(true); |
|
| 206 | - |
|
| 207 | - $node = new Folder($root, $view, '/foobar'); |
|
| 208 | - $child = new Folder($root, $view, '/foobar/asd/sdf', null, null); |
|
| 209 | - $result = $node->newFolder('asd/sdf'); |
|
| 210 | - $this->assertEquals($child, $result); |
|
| 211 | - } |
|
| 212 | - |
|
| 213 | - |
|
| 214 | - public function testNewFolderNotPermitted(): void { |
|
| 215 | - $this->expectException(NotPermittedException::class); |
|
| 216 | - |
|
| 217 | - $manager = $this->createMock(Manager::class); |
|
| 218 | - $view = $this->getRootViewMock(); |
|
| 219 | - $root = $this->getMockBuilder(Root::class) |
|
| 220 | - ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 221 | - ->getMock(); |
|
| 222 | - $root->method('getUser') |
|
| 223 | - ->willReturn($this->user); |
|
| 224 | - |
|
| 225 | - $view->method('getFileInfo') |
|
| 226 | - ->with('/bar/foo') |
|
| 227 | - ->willReturn($this->getFileInfo(['permissions' => Constants::PERMISSION_READ])); |
|
| 228 | - |
|
| 229 | - $node = new Folder($root, $view, '/bar/foo'); |
|
| 230 | - $node->newFolder('asd'); |
|
| 231 | - } |
|
| 232 | - |
|
| 233 | - public function testNewFile(): void { |
|
| 234 | - $manager = $this->createMock(Manager::class); |
|
| 235 | - $view = $this->getRootViewMock(); |
|
| 236 | - $root = $this->getMockBuilder(Root::class) |
|
| 237 | - ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 238 | - ->getMock(); |
|
| 239 | - $root->expects($this->any()) |
|
| 240 | - ->method('getUser') |
|
| 241 | - ->willReturn($this->user); |
|
| 242 | - |
|
| 243 | - $view->method('getFileInfo') |
|
| 244 | - ->with('/bar/foo') |
|
| 245 | - ->willReturn($this->getFileInfo(['permissions' => Constants::PERMISSION_ALL])); |
|
| 246 | - |
|
| 247 | - $view->method('touch') |
|
| 248 | - ->with('/bar/foo/asd') |
|
| 249 | - ->willReturn(true); |
|
| 250 | - |
|
| 251 | - $node = new Folder($root, $view, '/bar/foo'); |
|
| 252 | - $child = new File($root, $view, '/bar/foo/asd', null, $node); |
|
| 253 | - $result = $node->newFile('asd'); |
|
| 254 | - $this->assertEquals($child, $result); |
|
| 255 | - } |
|
| 256 | - |
|
| 257 | - |
|
| 258 | - public function testNewFileNotPermitted(): void { |
|
| 259 | - $this->expectException(NotPermittedException::class); |
|
| 260 | - |
|
| 261 | - $manager = $this->createMock(Manager::class); |
|
| 262 | - $view = $this->getRootViewMock(); |
|
| 263 | - $root = $this->getMockBuilder(Root::class) |
|
| 264 | - ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 265 | - ->getMock(); |
|
| 266 | - $root->method('getUser') |
|
| 267 | - ->willReturn($this->user); |
|
| 268 | - |
|
| 269 | - $view->method('getFileInfo') |
|
| 270 | - ->with('/bar/foo') |
|
| 271 | - ->willReturn($this->getFileInfo(['permissions' => Constants::PERMISSION_READ])); |
|
| 272 | - |
|
| 273 | - $node = new Folder($root, $view, '/bar/foo'); |
|
| 274 | - $node->newFile('asd'); |
|
| 275 | - } |
|
| 276 | - |
|
| 277 | - public function testGetFreeSpace(): void { |
|
| 278 | - $manager = $this->createMock(Manager::class); |
|
| 279 | - $view = $this->getRootViewMock(); |
|
| 280 | - $root = $this->getMockBuilder(Root::class) |
|
| 281 | - ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 282 | - ->getMock(); |
|
| 283 | - $root->method('getUser') |
|
| 284 | - ->willReturn($this->user); |
|
| 285 | - |
|
| 286 | - $view->method('free_space') |
|
| 287 | - ->with('/bar/foo') |
|
| 288 | - ->willReturn(100); |
|
| 289 | - |
|
| 290 | - $node = new Folder($root, $view, '/bar/foo'); |
|
| 291 | - $this->assertEquals(100, $node->getFreeSpace()); |
|
| 292 | - } |
|
| 293 | - |
|
| 294 | - public function testSearch(): void { |
|
| 295 | - $manager = $this->createMock(Manager::class); |
|
| 296 | - $view = $this->getRootViewMock(); |
|
| 297 | - $root = $this->getMockBuilder(Root::class) |
|
| 298 | - ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 299 | - ->getMock(); |
|
| 300 | - $root->method('getUser') |
|
| 301 | - ->willReturn($this->user); |
|
| 302 | - /** @var Storage\IStorage&MockObject $storage */ |
|
| 303 | - $storage = $this->createMock(IStorage::class); |
|
| 304 | - $storage->method('getId')->willReturn('test::1'); |
|
| 305 | - $cache = new Cache($storage); |
|
| 306 | - |
|
| 307 | - $storage->method('getCache') |
|
| 308 | - ->willReturn($cache); |
|
| 309 | - |
|
| 310 | - $storage->expects($this->atLeastOnce()) |
|
| 311 | - ->method('getOwner') |
|
| 312 | - ->with('qwerty') |
|
| 313 | - ->willReturn(false); |
|
| 314 | - |
|
| 315 | - $mount = $this->createMock(IMountPoint::class); |
|
| 316 | - $mount->expects($this->atLeastOnce()) |
|
| 317 | - ->method('getStorage') |
|
| 318 | - ->willReturn($storage); |
|
| 319 | - $mount->expects($this->atLeastOnce()) |
|
| 320 | - ->method('getInternalPath') |
|
| 321 | - ->willReturn('foo'); |
|
| 322 | - |
|
| 323 | - $cache->insert('', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 324 | - $cache->insert('foo', ['size' => 200, 'mtime' => 55, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 325 | - $cache->insert('foo/qwerty', ['size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain']); |
|
| 326 | - |
|
| 327 | - $root->method('getMountsIn') |
|
| 328 | - ->with('/bar/foo') |
|
| 329 | - ->willReturn([]); |
|
| 330 | - |
|
| 331 | - $root->method('getMount') |
|
| 332 | - ->with('/bar/foo') |
|
| 333 | - ->willReturn($mount); |
|
| 334 | - |
|
| 335 | - $node = new Folder($root, $view, '/bar/foo'); |
|
| 336 | - $result = $node->search('qw'); |
|
| 337 | - $cache->clear(); |
|
| 338 | - $this->assertEquals(1, count($result)); |
|
| 339 | - $this->assertEquals('/bar/foo/qwerty', $result[0]->getPath()); |
|
| 340 | - } |
|
| 341 | - |
|
| 342 | - public function testSearchInRoot(): void { |
|
| 343 | - $manager = $this->createMock(Manager::class); |
|
| 344 | - $view = $this->getRootViewMock(); |
|
| 345 | - $root = $this->getMockBuilder(Root::class) |
|
| 346 | - ->onlyMethods(['getUser', 'getMountsIn', 'getMount']) |
|
| 347 | - ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 348 | - ->getMock(); |
|
| 349 | - $root->expects($this->any()) |
|
| 350 | - ->method('getUser') |
|
| 351 | - ->willReturn($this->user); |
|
| 352 | - /** @var \PHPUnit\Framework\MockObject\MockObject|Storage $storage */ |
|
| 353 | - $storage = $this->createMock(IStorage::class); |
|
| 354 | - $storage->method('getId')->willReturn('test::2'); |
|
| 355 | - $cache = new Cache($storage); |
|
| 356 | - |
|
| 357 | - $mount = $this->createMock(IMountPoint::class); |
|
| 358 | - $mount->method('getStorage') |
|
| 359 | - ->willReturn($storage); |
|
| 360 | - $mount->method('getInternalPath') |
|
| 361 | - ->willReturn('files'); |
|
| 362 | - |
|
| 363 | - $storage->method('getCache') |
|
| 364 | - ->willReturn($cache); |
|
| 365 | - $storage->method('getOwner') |
|
| 366 | - ->willReturn('owner'); |
|
| 367 | - |
|
| 368 | - $cache->insert('', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 369 | - $cache->insert('files', ['size' => 200, 'mtime' => 55, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 370 | - $cache->insert('files/foo', ['size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain']); |
|
| 371 | - |
|
| 372 | - $root->method('getMountsIn') |
|
| 373 | - ->with('') |
|
| 374 | - ->willReturn([]); |
|
| 375 | - |
|
| 376 | - $root->method('getMount') |
|
| 377 | - ->with('') |
|
| 378 | - ->willReturn($mount); |
|
| 379 | - |
|
| 380 | - $result = $root->search('foo'); |
|
| 381 | - $cache->clear(); |
|
| 382 | - $this->assertEquals(1, count($result)); |
|
| 383 | - $this->assertEquals('/foo', $result[0]->getPath()); |
|
| 384 | - } |
|
| 385 | - |
|
| 386 | - public function testSearchInStorageRoot(): void { |
|
| 387 | - $manager = $this->createMock(Manager::class); |
|
| 388 | - $view = $this->getRootViewMock(); |
|
| 389 | - $root = $this->getMockBuilder(Root::class) |
|
| 390 | - ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 391 | - ->getMock(); |
|
| 392 | - $root->method('getUser') |
|
| 393 | - ->willReturn($this->user); |
|
| 394 | - $storage = $this->createMock(IStorage::class); |
|
| 395 | - $storage->method('getId')->willReturn('test::1'); |
|
| 396 | - $cache = new Cache($storage); |
|
| 397 | - |
|
| 398 | - $mount = $this->createMock(IMountPoint::class); |
|
| 399 | - $mount->method('getStorage') |
|
| 400 | - ->willReturn($storage); |
|
| 401 | - $mount->method('getInternalPath') |
|
| 402 | - ->willReturn(''); |
|
| 403 | - |
|
| 404 | - $storage->method('getCache') |
|
| 405 | - ->willReturn($cache); |
|
| 406 | - $storage->method('getOwner') |
|
| 407 | - ->willReturn('owner'); |
|
| 408 | - |
|
| 409 | - $cache->insert('', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 410 | - $cache->insert('foo', ['size' => 200, 'mtime' => 55, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 411 | - $cache->insert('foo/qwerty', ['size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain']); |
|
| 412 | - |
|
| 413 | - |
|
| 414 | - $root->method('getMountsIn') |
|
| 415 | - ->with('/bar') |
|
| 416 | - ->willReturn([]); |
|
| 417 | - |
|
| 418 | - $root->method('getMount') |
|
| 419 | - ->with('/bar') |
|
| 420 | - ->willReturn($mount); |
|
| 421 | - |
|
| 422 | - $node = new Folder($root, $view, '/bar'); |
|
| 423 | - $result = $node->search('qw'); |
|
| 424 | - $cache->clear(); |
|
| 425 | - $this->assertEquals(1, count($result)); |
|
| 426 | - $this->assertEquals('/bar/foo/qwerty', $result[0]->getPath()); |
|
| 427 | - } |
|
| 428 | - |
|
| 429 | - public function testSearchSubStorages(): void { |
|
| 430 | - $manager = $this->createMock(Manager::class); |
|
| 431 | - $view = $this->getRootViewMock(); |
|
| 432 | - $root = $this->getMockBuilder(Root::class) |
|
| 433 | - ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 434 | - ->getMock(); |
|
| 435 | - $root->expects($this->any()) |
|
| 436 | - ->method('getUser') |
|
| 437 | - ->willReturn($this->user); |
|
| 438 | - $storage = $this->createMock(IStorage::class); |
|
| 439 | - $storage->method('getId')->willReturn('test::1'); |
|
| 440 | - $cache = new Cache($storage); |
|
| 441 | - $subStorage = $this->createMock(IStorage::class); |
|
| 442 | - $subStorage->method('getId')->willReturn('test::2'); |
|
| 443 | - $subCache = new Cache($subStorage); |
|
| 444 | - $subMount = $this->getMockBuilder(MountPoint::class)->setConstructorArgs([Temporary::class, ''])->getMock(); |
|
| 445 | - |
|
| 446 | - $mount = $this->createMock(IMountPoint::class); |
|
| 447 | - $mount->method('getStorage') |
|
| 448 | - ->willReturn($storage); |
|
| 449 | - $mount->method('getInternalPath') |
|
| 450 | - ->willReturn('foo'); |
|
| 451 | - |
|
| 452 | - $subMount->method('getStorage') |
|
| 453 | - ->willReturn($subStorage); |
|
| 454 | - |
|
| 455 | - $subMount->method('getMountPoint') |
|
| 456 | - ->willReturn('/bar/foo/bar/'); |
|
| 457 | - |
|
| 458 | - $storage->method('getCache') |
|
| 459 | - ->willReturn($cache); |
|
| 460 | - $storage->method('getOwner') |
|
| 461 | - ->willReturn('owner'); |
|
| 462 | - |
|
| 463 | - $subStorage->method('getCache') |
|
| 464 | - ->willReturn($subCache); |
|
| 465 | - $subStorage->method('getOwner') |
|
| 466 | - ->willReturn('owner'); |
|
| 467 | - |
|
| 468 | - $cache->insert('', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 469 | - $cache->insert('foo', ['size' => 200, 'mtime' => 55, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 470 | - $cache->insert('foo/qwerty', ['size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain']); |
|
| 471 | - |
|
| 472 | - $subCache->insert('', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 473 | - $subCache->insert('asd', ['size' => 200, 'mtime' => 55, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 474 | - $subCache->insert('asd/qwerty', ['size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain']); |
|
| 475 | - |
|
| 476 | - |
|
| 477 | - $root->method('getMountsIn') |
|
| 478 | - ->with('/bar/foo') |
|
| 479 | - ->willReturn([$subMount]); |
|
| 480 | - |
|
| 481 | - $root->method('getMount') |
|
| 482 | - ->with('/bar/foo') |
|
| 483 | - ->willReturn($mount); |
|
| 484 | - |
|
| 485 | - |
|
| 486 | - $node = new Folder($root, $view, '/bar/foo'); |
|
| 487 | - $result = $node->search('qw'); |
|
| 488 | - $cache->clear(); |
|
| 489 | - $subCache->clear(); |
|
| 490 | - $this->assertEquals(2, count($result)); |
|
| 491 | - } |
|
| 492 | - |
|
| 493 | - public function testIsSubNode(): void { |
|
| 494 | - $rootFolderMock = $this->createMock(IRootFolder::class); |
|
| 495 | - $file = new Node($rootFolderMock, $this->view, '/foo/bar'); |
|
| 496 | - $folder = new Folder($rootFolderMock, $this->view, '/foo'); |
|
| 497 | - $this->assertTrue($folder->isSubNode($file)); |
|
| 498 | - $this->assertFalse($folder->isSubNode($folder)); |
|
| 499 | - |
|
| 500 | - $file = new Node($rootFolderMock, $this->view, '/foobar'); |
|
| 501 | - $this->assertFalse($folder->isSubNode($file)); |
|
| 502 | - } |
|
| 503 | - |
|
| 504 | - public function testGetById(): void { |
|
| 505 | - $manager = $this->createMock(Manager::class); |
|
| 506 | - $view = $this->getRootViewMock(); |
|
| 507 | - $root = $this->getMockBuilder(Root::class) |
|
| 508 | - ->onlyMethods(['getMountsIn', 'getMount']) |
|
| 509 | - ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 510 | - ->getMock(); |
|
| 511 | - $storage = $this->createMock(Storage::class); |
|
| 512 | - $mount = new MountPoint($storage, '/bar'); |
|
| 513 | - $storage->method('getId')->willReturn(''); |
|
| 514 | - $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([$storage])->getMock(); |
|
| 515 | - |
|
| 516 | - $fileInfo = new CacheEntry(['path' => 'foo/qwerty', 'mimetype' => 'text/plain'], null); |
|
| 517 | - |
|
| 518 | - $storage->method('getCache') |
|
| 519 | - ->willReturn($cache); |
|
| 520 | - $storage->method('getOwner') |
|
| 521 | - ->willReturn('owner'); |
|
| 522 | - |
|
| 523 | - $this->userMountCache->expects($this->any()) |
|
| 524 | - ->method('getMountsForFileId') |
|
| 525 | - ->with(1) |
|
| 526 | - ->willReturn([new CachedMountInfo( |
|
| 527 | - $this->user, |
|
| 528 | - 1, |
|
| 529 | - 0, |
|
| 530 | - '/bar/', |
|
| 531 | - 'test', |
|
| 532 | - 1, |
|
| 533 | - '' |
|
| 534 | - )]); |
|
| 535 | - |
|
| 536 | - $cache->method('get') |
|
| 537 | - ->with(1) |
|
| 538 | - ->willReturn($fileInfo); |
|
| 539 | - |
|
| 540 | - $root->method('getMountsIn') |
|
| 541 | - ->with('/bar/foo') |
|
| 542 | - ->willReturn([]); |
|
| 543 | - |
|
| 544 | - $manager->method('getMountsByMountProvider') |
|
| 545 | - ->willReturn([$mount]); |
|
| 546 | - |
|
| 547 | - $node = new Folder($root, $view, '/bar/foo'); |
|
| 548 | - $result = $node->getById(1); |
|
| 549 | - $this->assertEquals(1, count($result)); |
|
| 550 | - $this->assertEquals('/bar/foo/qwerty', $result[0]->getPath()); |
|
| 551 | - } |
|
| 552 | - |
|
| 553 | - public function testGetByIdMountRoot(): void { |
|
| 554 | - $manager = $this->createMock(Manager::class); |
|
| 555 | - $view = $this->getRootViewMock(); |
|
| 556 | - $root = $this->getMockBuilder(Root::class) |
|
| 557 | - ->onlyMethods(['getMountsIn', 'getMount']) |
|
| 558 | - ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 559 | - ->getMock(); |
|
| 560 | - $storage = $this->createMock(Storage::class); |
|
| 561 | - $mount = new MountPoint($storage, '/bar'); |
|
| 562 | - $storage->method('getId')->willReturn(''); |
|
| 563 | - $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([$storage])->getMock(); |
|
| 564 | - |
|
| 565 | - $fileInfo = new CacheEntry(['path' => '', 'mimetype' => 'text/plain'], null); |
|
| 566 | - |
|
| 567 | - $storage->method('getCache') |
|
| 568 | - ->willReturn($cache); |
|
| 569 | - $storage->method('getOwner') |
|
| 570 | - ->willReturn('owner'); |
|
| 571 | - |
|
| 572 | - $this->userMountCache->expects($this->any()) |
|
| 573 | - ->method('getMountsForFileId') |
|
| 574 | - ->with(1) |
|
| 575 | - ->willReturn([new CachedMountInfo( |
|
| 576 | - $this->user, |
|
| 577 | - 1, |
|
| 578 | - 0, |
|
| 579 | - '/bar/', |
|
| 580 | - 'test', |
|
| 581 | - 1, |
|
| 582 | - '' |
|
| 583 | - )]); |
|
| 584 | - |
|
| 585 | - $cache->method('get') |
|
| 586 | - ->with(1) |
|
| 587 | - ->willReturn($fileInfo); |
|
| 588 | - |
|
| 589 | - $manager->method('getMountsByMountProvider') |
|
| 590 | - ->willReturn([$mount]); |
|
| 591 | - |
|
| 592 | - $node = new Folder($root, $view, '/bar'); |
|
| 593 | - $result = $node->getById(1); |
|
| 594 | - $this->assertEquals(1, count($result)); |
|
| 595 | - $this->assertEquals('/bar', $result[0]->getPath()); |
|
| 596 | - } |
|
| 597 | - |
|
| 598 | - public function testGetByIdOutsideFolder(): void { |
|
| 599 | - $manager = $this->createMock(Manager::class); |
|
| 600 | - $view = $this->getRootViewMock(); |
|
| 601 | - $root = $this->getMockBuilder(Root::class) |
|
| 602 | - ->onlyMethods(['getMountsIn', 'getMount']) |
|
| 603 | - ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 604 | - ->getMock(); |
|
| 605 | - $storage = $this->createMock(Storage::class); |
|
| 606 | - $mount = new MountPoint($storage, '/bar'); |
|
| 607 | - $storage->method('getId')->willReturn(''); |
|
| 608 | - $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([$storage])->getMock(); |
|
| 609 | - |
|
| 610 | - $fileInfo = new CacheEntry(['path' => 'foobar', 'mimetype' => 'text/plain'], null); |
|
| 611 | - |
|
| 612 | - $storage->method('getCache') |
|
| 613 | - ->willReturn($cache); |
|
| 614 | - $storage->method('getOwner') |
|
| 615 | - ->willReturn('owner'); |
|
| 616 | - |
|
| 617 | - $this->userMountCache->expects($this->any()) |
|
| 618 | - ->method('getMountsForFileId') |
|
| 619 | - ->with(1) |
|
| 620 | - ->willReturn([new CachedMountInfo( |
|
| 621 | - $this->user, |
|
| 622 | - 1, |
|
| 623 | - 0, |
|
| 624 | - '/bar/', |
|
| 625 | - 'test', |
|
| 626 | - 1, |
|
| 627 | - '' |
|
| 628 | - )]); |
|
| 629 | - |
|
| 630 | - $cache->method('get') |
|
| 631 | - ->with(1) |
|
| 632 | - ->willReturn($fileInfo); |
|
| 633 | - |
|
| 634 | - $manager->method('getMountsByMountProvider') |
|
| 635 | - ->willReturn([$mount]); |
|
| 636 | - |
|
| 637 | - $node = new Folder($root, $view, '/bar/foo'); |
|
| 638 | - $result = $node->getById(1); |
|
| 639 | - $this->assertEquals(0, count($result)); |
|
| 640 | - } |
|
| 641 | - |
|
| 642 | - public function testGetByIdMultipleStorages(): void { |
|
| 643 | - $manager = $this->createMock(Manager::class); |
|
| 644 | - $view = $this->getRootViewMock(); |
|
| 645 | - $root = $this->getMockBuilder(Root::class) |
|
| 646 | - ->onlyMethods(['getMountsIn', 'getMount']) |
|
| 647 | - ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 648 | - ->getMock(); |
|
| 649 | - $storage = $this->createMock(Storage::class); |
|
| 650 | - $mount1 = new MountPoint($storage, '/bar'); |
|
| 651 | - $mount2 = new MountPoint($storage, '/bar/foo/asd'); |
|
| 652 | - $storage->method('getId')->willReturn(''); |
|
| 653 | - $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([$storage])->getMock(); |
|
| 654 | - |
|
| 655 | - $fileInfo = new CacheEntry(['path' => 'foo/qwerty', 'mimetype' => 'text/plain'], null); |
|
| 656 | - |
|
| 657 | - $storage->method('getCache') |
|
| 658 | - ->willReturn($cache); |
|
| 659 | - $storage->method('getOwner') |
|
| 660 | - ->willReturn('owner'); |
|
| 661 | - |
|
| 662 | - $this->userMountCache->method('getMountsForFileId') |
|
| 663 | - ->with(1) |
|
| 664 | - ->willReturn([ |
|
| 665 | - new CachedMountInfo( |
|
| 666 | - $this->user, |
|
| 667 | - 1, |
|
| 668 | - 0, |
|
| 669 | - '/bar/', |
|
| 670 | - 'test', |
|
| 671 | - 1, |
|
| 672 | - '' |
|
| 673 | - ), |
|
| 674 | - ]); |
|
| 675 | - |
|
| 676 | - $cache->method('get') |
|
| 677 | - ->with(1) |
|
| 678 | - ->willReturn($fileInfo); |
|
| 679 | - |
|
| 680 | - $manager->method('getMountsByMountProvider') |
|
| 681 | - ->willReturn([$mount1, $mount2]); |
|
| 682 | - |
|
| 683 | - $node = new Folder($root, $view, '/bar/foo'); |
|
| 684 | - $result = $node->getById(1); |
|
| 685 | - $this->assertEquals(2, count($result)); |
|
| 686 | - $this->assertEquals('/bar/foo/qwerty', $result[0]->getPath()); |
|
| 687 | - $this->assertEquals('/bar/foo/asd/foo/qwerty', $result[1]->getPath()); |
|
| 688 | - } |
|
| 689 | - |
|
| 690 | - public static function uniqueNameProvider(): array { |
|
| 691 | - return [ |
|
| 692 | - // input, existing, expected |
|
| 693 | - ['foo', [], 'foo'], |
|
| 694 | - ['foo', ['foo'], 'foo (2)'], |
|
| 695 | - ['foo', ['foo', 'foo (2)'], 'foo (3)'], |
|
| 696 | - ]; |
|
| 697 | - } |
|
| 698 | - |
|
| 699 | - #[\PHPUnit\Framework\Attributes\DataProvider('uniqueNameProvider')] |
|
| 700 | - public function testGetUniqueName($name, $existingFiles, $expected): void { |
|
| 701 | - $manager = $this->createMock(Manager::class); |
|
| 702 | - $folderPath = '/bar/foo'; |
|
| 703 | - $view = $this->getRootViewMock(); |
|
| 704 | - $root = $this->getMockBuilder(Root::class) |
|
| 705 | - ->onlyMethods(['getUser', 'getMountsIn', 'getMount']) |
|
| 706 | - ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 707 | - ->getMock(); |
|
| 708 | - |
|
| 709 | - $view->expects($this->any()) |
|
| 710 | - ->method('file_exists') |
|
| 711 | - ->willReturnCallback(function ($path) use ($existingFiles, $folderPath) { |
|
| 712 | - foreach ($existingFiles as $existing) { |
|
| 713 | - if ($folderPath . '/' . $existing === $path) { |
|
| 714 | - return true; |
|
| 715 | - } |
|
| 716 | - } |
|
| 717 | - return false; |
|
| 718 | - }); |
|
| 719 | - |
|
| 720 | - $node = new Folder($root, $view, $folderPath); |
|
| 721 | - $this->assertEquals($expected, $node->getNonExistingName($name)); |
|
| 722 | - } |
|
| 723 | - |
|
| 724 | - public function testRecent(): void { |
|
| 725 | - $manager = $this->createMock(Manager::class); |
|
| 726 | - $folderPath = '/bar/foo'; |
|
| 727 | - $view = $this->getRootViewMock(); |
|
| 728 | - /** @var \PHPUnit\Framework\MockObject\MockObject|\OC\Files\Node\Root $root */ |
|
| 729 | - $root = $this->getMockBuilder(Root::class) |
|
| 730 | - ->onlyMethods(['getUser', 'getMountsIn', 'getMount']) |
|
| 731 | - ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 732 | - ->getMock(); |
|
| 733 | - /** @var \PHPUnit\Framework\MockObject\MockObject|FileInfo $folderInfo */ |
|
| 734 | - $folderInfo = $this->getMockBuilder(FileInfo::class) |
|
| 735 | - ->disableOriginalConstructor()->getMock(); |
|
| 736 | - |
|
| 737 | - $baseTime = time(); |
|
| 738 | - $storage = new Temporary(); |
|
| 739 | - $mount = new MountPoint($storage, ''); |
|
| 740 | - |
|
| 741 | - $folderInfo->expects($this->any()) |
|
| 742 | - ->method('getMountPoint') |
|
| 743 | - ->willReturn($mount); |
|
| 744 | - $root->method('getMount') |
|
| 745 | - ->willReturn($mount); |
|
| 746 | - $root->method('getMountsIn') |
|
| 747 | - ->willReturn([]); |
|
| 748 | - |
|
| 749 | - $cache = $storage->getCache(); |
|
| 750 | - |
|
| 751 | - $cache->insert('', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 752 | - $cache->insert('bar', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 753 | - $cache->insert('bar/foo', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 754 | - $cache->insert('bar/asd', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 755 | - $id1 = $cache->put('bar/foo/inside.txt', [ |
|
| 756 | - 'storage_mtime' => $baseTime, |
|
| 757 | - 'mtime' => $baseTime, |
|
| 758 | - 'mimetype' => 'text/plain', |
|
| 759 | - 'size' => 3, |
|
| 760 | - 'permissions' => Constants::PERMISSION_ALL, |
|
| 761 | - ]); |
|
| 762 | - $id2 = $cache->put('bar/foo/old.txt', [ |
|
| 763 | - 'storage_mtime' => $baseTime - 100, |
|
| 764 | - 'mtime' => $baseTime - 100, |
|
| 765 | - 'mimetype' => 'text/plain', |
|
| 766 | - 'size' => 3, |
|
| 767 | - 'permissions' => Constants::PERMISSION_READ, |
|
| 768 | - ]); |
|
| 769 | - $cache->put('bar/asd/outside.txt', [ |
|
| 770 | - 'storage_mtime' => $baseTime, |
|
| 771 | - 'mtime' => $baseTime, |
|
| 772 | - 'mimetype' => 'text/plain', |
|
| 773 | - 'size' => 3, |
|
| 774 | - ]); |
|
| 775 | - $id3 = $cache->put('bar/foo/older.txt', [ |
|
| 776 | - 'storage_mtime' => $baseTime - 600, |
|
| 777 | - 'mtime' => $baseTime - 600, |
|
| 778 | - 'mimetype' => 'text/plain', |
|
| 779 | - 'size' => 3, |
|
| 780 | - 'permissions' => Constants::PERMISSION_ALL, |
|
| 781 | - ]); |
|
| 782 | - |
|
| 783 | - $node = new Folder($root, $view, $folderPath, $folderInfo); |
|
| 784 | - |
|
| 785 | - |
|
| 786 | - $nodes = $node->getRecent(5); |
|
| 787 | - $ids = array_map(function (Node $node) { |
|
| 788 | - return (int)$node->getId(); |
|
| 789 | - }, $nodes); |
|
| 790 | - $this->assertEquals([$id1, $id2, $id3], $ids); |
|
| 791 | - } |
|
| 792 | - |
|
| 793 | - public function testRecentFolder(): void { |
|
| 794 | - $manager = $this->createMock(Manager::class); |
|
| 795 | - $folderPath = '/bar/foo'; |
|
| 796 | - $view = $this->getRootViewMock(); |
|
| 797 | - /** @var \PHPUnit\Framework\MockObject\MockObject|\OC\Files\Node\Root $root */ |
|
| 798 | - $root = $this->getMockBuilder(Root::class) |
|
| 799 | - ->onlyMethods(['getUser', 'getMountsIn', 'getMount']) |
|
| 800 | - ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 801 | - ->getMock(); |
|
| 802 | - /** @var \PHPUnit\Framework\MockObject\MockObject|FileInfo $folderInfo */ |
|
| 803 | - $folderInfo = $this->getMockBuilder(FileInfo::class) |
|
| 804 | - ->disableOriginalConstructor()->getMock(); |
|
| 805 | - |
|
| 806 | - $baseTime = time(); |
|
| 807 | - $storage = new Temporary(); |
|
| 808 | - $mount = new MountPoint($storage, ''); |
|
| 809 | - |
|
| 810 | - $folderInfo->expects($this->any()) |
|
| 811 | - ->method('getMountPoint') |
|
| 812 | - ->willReturn($mount); |
|
| 813 | - |
|
| 814 | - $root->method('getMount') |
|
| 815 | - ->willReturn($mount); |
|
| 816 | - $root->method('getMountsIn') |
|
| 817 | - ->willReturn([]); |
|
| 818 | - |
|
| 819 | - $cache = $storage->getCache(); |
|
| 820 | - |
|
| 821 | - $cache->insert('', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 822 | - $cache->insert('bar', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 823 | - $cache->insert('bar/foo', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 824 | - $id1 = $cache->put('bar/foo/folder', [ |
|
| 825 | - 'storage_mtime' => $baseTime, |
|
| 826 | - 'mtime' => $baseTime, |
|
| 827 | - 'mimetype' => \OCP\Files\FileInfo::MIMETYPE_FOLDER, |
|
| 828 | - 'size' => 3, |
|
| 829 | - 'permissions' => 0, |
|
| 830 | - ]); |
|
| 831 | - $id2 = $cache->put('bar/foo/folder/bar.txt', [ |
|
| 832 | - 'storage_mtime' => $baseTime, |
|
| 833 | - 'mtime' => $baseTime, |
|
| 834 | - 'mimetype' => 'text/plain', |
|
| 835 | - 'size' => 3, |
|
| 836 | - 'parent' => $id1, |
|
| 837 | - 'permissions' => Constants::PERMISSION_ALL, |
|
| 838 | - ]); |
|
| 839 | - $id3 = $cache->put('bar/foo/folder/asd.txt', [ |
|
| 840 | - 'storage_mtime' => $baseTime - 100, |
|
| 841 | - 'mtime' => $baseTime - 100, |
|
| 842 | - 'mimetype' => 'text/plain', |
|
| 843 | - 'size' => 3, |
|
| 844 | - 'parent' => $id1, |
|
| 845 | - 'permissions' => Constants::PERMISSION_ALL, |
|
| 846 | - ]); |
|
| 847 | - |
|
| 848 | - $node = new Folder($root, $view, $folderPath, $folderInfo); |
|
| 849 | - |
|
| 850 | - |
|
| 851 | - $nodes = $node->getRecent(5); |
|
| 852 | - $ids = array_map(function (Node $node) { |
|
| 853 | - return (int)$node->getId(); |
|
| 854 | - }, $nodes); |
|
| 855 | - $this->assertEquals([$id2, $id3], $ids); |
|
| 856 | - $this->assertEquals($baseTime, $nodes[0]->getMTime()); |
|
| 857 | - $this->assertEquals($baseTime - 100, $nodes[1]->getMTime()); |
|
| 858 | - } |
|
| 859 | - |
|
| 860 | - public function testRecentJail(): void { |
|
| 861 | - $manager = $this->createMock(Manager::class); |
|
| 862 | - $folderPath = '/bar/foo'; |
|
| 863 | - $view = $this->getRootViewMock(); |
|
| 864 | - /** @var \PHPUnit\Framework\MockObject\MockObject|\OC\Files\Node\Root $root */ |
|
| 865 | - $root = $this->getMockBuilder(Root::class) |
|
| 866 | - ->onlyMethods(['getUser', 'getMountsIn', 'getMount']) |
|
| 867 | - ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 868 | - ->getMock(); |
|
| 869 | - /** @var \PHPUnit\Framework\MockObject\MockObject|FileInfo $folderInfo */ |
|
| 870 | - $folderInfo = $this->getMockBuilder(FileInfo::class) |
|
| 871 | - ->disableOriginalConstructor()->getMock(); |
|
| 872 | - |
|
| 873 | - $baseTime = time(); |
|
| 874 | - $storage = new Temporary(); |
|
| 875 | - $jail = new Jail([ |
|
| 876 | - 'storage' => $storage, |
|
| 877 | - 'root' => 'folder', |
|
| 878 | - ]); |
|
| 879 | - $mount = new MountPoint($jail, '/bar/foo'); |
|
| 880 | - |
|
| 881 | - $folderInfo->expects($this->any()) |
|
| 882 | - ->method('getMountPoint') |
|
| 883 | - ->willReturn($mount); |
|
| 884 | - $root->method('getMount') |
|
| 885 | - ->willReturn($mount); |
|
| 886 | - $root->method('getMountsIn') |
|
| 887 | - ->willReturn([]); |
|
| 888 | - |
|
| 889 | - $cache = $storage->getCache(); |
|
| 890 | - |
|
| 891 | - $cache->insert('', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 892 | - $cache->insert('folder', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 893 | - $id1 = $cache->put('folder/inside.txt', [ |
|
| 894 | - 'storage_mtime' => $baseTime, |
|
| 895 | - 'mtime' => $baseTime, |
|
| 896 | - 'mimetype' => 'text/plain', |
|
| 897 | - 'size' => 3, |
|
| 898 | - 'permissions' => Constants::PERMISSION_ALL, |
|
| 899 | - ]); |
|
| 900 | - |
|
| 901 | - $cache->put('outside.txt', [ |
|
| 902 | - 'storage_mtime' => $baseTime - 100, |
|
| 903 | - 'mtime' => $baseTime - 100, |
|
| 904 | - 'mimetype' => 'text/plain', |
|
| 905 | - 'size' => 3, |
|
| 906 | - ]); |
|
| 907 | - |
|
| 908 | - $node = new Folder($root, $view, $folderPath, $folderInfo); |
|
| 909 | - |
|
| 910 | - $nodes = $node->getRecent(5); |
|
| 911 | - $ids = array_map(function (Node $node) { |
|
| 912 | - return (int)$node->getId(); |
|
| 913 | - }, $nodes); |
|
| 914 | - $this->assertEquals([$id1], $ids); |
|
| 915 | - } |
|
| 916 | - |
|
| 917 | - public static function offsetLimitProvider(): array { |
|
| 918 | - return [ |
|
| 919 | - [0, 10, ['/bar/foo/foo1', '/bar/foo/foo2', '/bar/foo/foo3', '/bar/foo/foo4', '/bar/foo/sub1/foo5', '/bar/foo/sub1/foo6', '/bar/foo/sub2/foo7', '/bar/foo/sub2/foo8'], []], |
|
| 920 | - [0, 5, ['/bar/foo/foo1', '/bar/foo/foo2', '/bar/foo/foo3', '/bar/foo/foo4', '/bar/foo/sub1/foo5'], []], |
|
| 921 | - [0, 2, ['/bar/foo/foo1', '/bar/foo/foo2'], []], |
|
| 922 | - [3, 2, ['/bar/foo/foo4', '/bar/foo/sub1/foo5'], []], |
|
| 923 | - [3, 5, ['/bar/foo/foo4', '/bar/foo/sub1/foo5', '/bar/foo/sub1/foo6', '/bar/foo/sub2/foo7', '/bar/foo/sub2/foo8'], []], |
|
| 924 | - [5, 2, ['/bar/foo/sub1/foo6', '/bar/foo/sub2/foo7'], []], |
|
| 925 | - [6, 2, ['/bar/foo/sub2/foo7', '/bar/foo/sub2/foo8'], []], |
|
| 926 | - [7, 2, ['/bar/foo/sub2/foo8'], []], |
|
| 927 | - [10, 2, [], []], |
|
| 928 | - [0, 5, ['/bar/foo/sub2/foo7', '/bar/foo/foo1', '/bar/foo/sub1/foo5', '/bar/foo/foo2', '/bar/foo/foo3'], [new SearchOrder(ISearchOrder::DIRECTION_ASCENDING, 'mtime')]], |
|
| 929 | - [3, 2, ['/bar/foo/foo2', '/bar/foo/foo3'], [new SearchOrder(ISearchOrder::DIRECTION_ASCENDING, 'mtime')]], |
|
| 930 | - [0, 5, ['/bar/foo/sub1/foo5', '/bar/foo/sub1/foo6', '/bar/foo/sub2/foo7', '/bar/foo/foo1', '/bar/foo/foo2'], [ |
|
| 931 | - new SearchOrder(ISearchOrder::DIRECTION_DESCENDING, 'size'), |
|
| 932 | - new SearchOrder(ISearchOrder::DIRECTION_ASCENDING, 'mtime') |
|
| 933 | - ]], |
|
| 934 | - ]; |
|
| 935 | - } |
|
| 936 | - |
|
| 937 | - /** |
|
| 938 | - * @param int $offset |
|
| 939 | - * @param int $limit |
|
| 940 | - * @param string[] $expectedPaths |
|
| 941 | - * @param ISearchOrder[] $ordering |
|
| 942 | - * @throws NotFoundException |
|
| 943 | - * @throws InvalidPathException |
|
| 944 | - */ |
|
| 945 | - #[\PHPUnit\Framework\Attributes\DataProvider('offsetLimitProvider')] |
|
| 946 | - public function testSearchSubStoragesLimitOffset(int $offset, int $limit, array $expectedPaths, array $ordering): void { |
|
| 947 | - if (!$ordering) { |
|
| 948 | - $ordering = [new SearchOrder(ISearchOrder::DIRECTION_ASCENDING, 'fileid')]; |
|
| 949 | - } |
|
| 950 | - |
|
| 951 | - $manager = $this->createMock(Manager::class); |
|
| 952 | - $view = $this->getRootViewMock(); |
|
| 953 | - $root = $this->getMockBuilder(Root::class) |
|
| 954 | - ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 955 | - ->getMock(); |
|
| 956 | - $root->expects($this->any()) |
|
| 957 | - ->method('getUser') |
|
| 958 | - ->willReturn($this->user); |
|
| 959 | - $storage = $this->createMock(IStorage::class); |
|
| 960 | - $storage->method('getId')->willReturn('test::1'); |
|
| 961 | - $cache = new Cache($storage); |
|
| 962 | - $subStorage1 = $this->createMock(IStorage::class); |
|
| 963 | - $subStorage1->method('getId')->willReturn('test::2'); |
|
| 964 | - $subCache1 = new Cache($subStorage1); |
|
| 965 | - $subMount1 = $this->getMockBuilder(MountPoint::class)->setConstructorArgs([Temporary::class, ''])->getMock(); |
|
| 966 | - $subStorage2 = $this->createMock(IStorage::class); |
|
| 967 | - $subStorage2->method('getId')->willReturn('test::3'); |
|
| 968 | - $subCache2 = new Cache($subStorage2); |
|
| 969 | - $subMount2 = $this->getMockBuilder(MountPoint::class)->setConstructorArgs([Temporary::class, ''])->getMock(); |
|
| 970 | - |
|
| 971 | - $mount = $this->createMock(IMountPoint::class); |
|
| 972 | - $mount->method('getStorage') |
|
| 973 | - ->willReturn($storage); |
|
| 974 | - $mount->method('getInternalPath') |
|
| 975 | - ->willReturn('foo'); |
|
| 976 | - |
|
| 977 | - $subMount1->method('getStorage') |
|
| 978 | - ->willReturn($subStorage1); |
|
| 979 | - |
|
| 980 | - $subMount1->method('getMountPoint') |
|
| 981 | - ->willReturn('/bar/foo/sub1/'); |
|
| 982 | - |
|
| 983 | - $storage->method('getCache') |
|
| 984 | - ->willReturn($cache); |
|
| 985 | - $storage->method('getOwner') |
|
| 986 | - ->willReturn('owner'); |
|
| 987 | - |
|
| 988 | - $subStorage1->method('getCache') |
|
| 989 | - ->willReturn($subCache1); |
|
| 990 | - $subStorage1->method('getOwner') |
|
| 991 | - ->willReturn('owner'); |
|
| 992 | - |
|
| 993 | - $subMount2->method('getStorage') |
|
| 994 | - ->willReturn($subStorage2); |
|
| 995 | - |
|
| 996 | - $subMount2->method('getMountPoint') |
|
| 997 | - ->willReturn('/bar/foo/sub2/'); |
|
| 998 | - |
|
| 999 | - $subStorage2->method('getCache') |
|
| 1000 | - ->willReturn($subCache2); |
|
| 1001 | - $subStorage2->method('getOwner') |
|
| 1002 | - ->willReturn('owner'); |
|
| 1003 | - |
|
| 1004 | - |
|
| 1005 | - $cache->insert('', ['size' => 0, 'mtime' => 10, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 1006 | - $cache->insert('foo', ['size' => 0, 'mtime' => 10, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 1007 | - $cache->insert('foo/foo1', ['size' => 200, 'mtime' => 10, 'mimetype' => 'text/plain']); |
|
| 1008 | - $cache->insert('foo/foo2', ['size' => 200, 'mtime' => 20, 'mimetype' => 'text/plain']); |
|
| 1009 | - $cache->insert('foo/foo3', ['size' => 200, 'mtime' => 30, 'mimetype' => 'text/plain']); |
|
| 1010 | - $cache->insert('foo/foo4', ['size' => 200, 'mtime' => 40, 'mimetype' => 'text/plain']); |
|
| 1011 | - |
|
| 1012 | - $subCache1->insert('', ['size' => 0, 'mtime' => 10, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 1013 | - $subCache1->insert('foo5', ['size' => 300, 'mtime' => 15, 'mimetype' => 'text/plain']); |
|
| 1014 | - $subCache1->insert('foo6', ['size' => 300, 'mtime' => 50, 'mimetype' => 'text/plain']); |
|
| 1015 | - |
|
| 1016 | - $subCache2->insert('', ['size' => 0, 'mtime' => 10, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 1017 | - $subCache2->insert('foo7', ['size' => 200, 'mtime' => 5, 'mimetype' => 'text/plain']); |
|
| 1018 | - $subCache2->insert('foo8', ['size' => 200, 'mtime' => 60, 'mimetype' => 'text/plain']); |
|
| 1019 | - |
|
| 1020 | - $root->method('getMountsIn') |
|
| 1021 | - ->with('/bar/foo') |
|
| 1022 | - ->willReturn([$subMount1, $subMount2]); |
|
| 1023 | - |
|
| 1024 | - $root->method('getMount') |
|
| 1025 | - ->with('/bar/foo') |
|
| 1026 | - ->willReturn($mount); |
|
| 1027 | - |
|
| 1028 | - $node = new Folder($root, $view, '/bar/foo'); |
|
| 1029 | - $comparison = new SearchComparison(ISearchComparison::COMPARE_LIKE, 'name', '%foo%'); |
|
| 1030 | - $operator = new SearchBinaryOperator(ISearchBinaryOperator::OPERATOR_AND, [ |
|
| 1031 | - $comparison, |
|
| 1032 | - new SearchBinaryOperator(ISearchBinaryOperator::OPERATOR_NOT, [new SearchComparison(ISearchComparison::COMPARE_EQUAL, 'mimetype', ICacheEntry::DIRECTORY_MIMETYPE)]), |
|
| 1033 | - ]); |
|
| 1034 | - $query = new SearchQuery($operator, $limit, $offset, $ordering); |
|
| 1035 | - $result = $node->search($query); |
|
| 1036 | - $cache->clear(); |
|
| 1037 | - $subCache1->clear(); |
|
| 1038 | - $subCache2->clear(); |
|
| 1039 | - $ids = array_map(function (Node $info) { |
|
| 1040 | - return $info->getPath(); |
|
| 1041 | - }, $result); |
|
| 1042 | - $this->assertEquals($expectedPaths, $ids); |
|
| 1043 | - } |
|
| 50 | + protected function createTestNode($root, $view, $path, array $data = [], $internalPath = '', $storage = null) { |
|
| 51 | + $view->expects($this->any()) |
|
| 52 | + ->method('getRoot') |
|
| 53 | + ->willReturn(''); |
|
| 54 | + if ($data || $internalPath || $storage) { |
|
| 55 | + return new Folder($root, $view, $path, $this->getFileInfo($data, $internalPath, $storage)); |
|
| 56 | + } else { |
|
| 57 | + return new Folder($root, $view, $path); |
|
| 58 | + } |
|
| 59 | + } |
|
| 60 | + |
|
| 61 | + protected function getNodeClass() { |
|
| 62 | + return '\OC\Files\Node\Folder'; |
|
| 63 | + } |
|
| 64 | + |
|
| 65 | + protected function getNonExistingNodeClass() { |
|
| 66 | + return '\OC\Files\Node\NonExistingFolder'; |
|
| 67 | + } |
|
| 68 | + |
|
| 69 | + protected function getViewDeleteMethod() { |
|
| 70 | + return 'rmdir'; |
|
| 71 | + } |
|
| 72 | + |
|
| 73 | + public function testGetDirectoryContent(): void { |
|
| 74 | + $manager = $this->createMock(Manager::class); |
|
| 75 | + /** |
|
| 76 | + * @var View|\PHPUnit\Framework\MockObject\MockObject $view |
|
| 77 | + */ |
|
| 78 | + $root = $this->getMockBuilder(Root::class) |
|
| 79 | + ->setConstructorArgs([$manager, $this->view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 80 | + ->getMock(); |
|
| 81 | + $root->expects($this->any()) |
|
| 82 | + ->method('getUser') |
|
| 83 | + ->willReturn($this->user); |
|
| 84 | + |
|
| 85 | + $this->view->expects($this->any()) |
|
| 86 | + ->method('getDirectoryContent') |
|
| 87 | + ->with('/bar/foo') |
|
| 88 | + ->willReturn([ |
|
| 89 | + new FileInfo('/bar/foo/asd', null, 'foo/asd', ['fileid' => 2, 'path' => '/bar/foo/asd', 'name' => 'asd', 'size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain'], null), |
|
| 90 | + new FileInfo('/bar/foo/qwerty', null, 'foo/qwerty', ['fileid' => 3, 'path' => '/bar/foo/qwerty', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'httpd/unix-directory'], null), |
|
| 91 | + ]); |
|
| 92 | + $this->view->method('getFileInfo') |
|
| 93 | + ->willReturn($this->createMock(FileInfo::class)); |
|
| 94 | + $this->view->method('getRelativePath') |
|
| 95 | + ->willReturn('/bar/foo'); |
|
| 96 | + |
|
| 97 | + $node = new Folder($root, $this->view, '/bar/foo'); |
|
| 98 | + $children = $node->getDirectoryListing(); |
|
| 99 | + $this->assertEquals(2, count($children)); |
|
| 100 | + $this->assertInstanceOf('\OC\Files\Node\File', $children[0]); |
|
| 101 | + $this->assertInstanceOf('\OC\Files\Node\Folder', $children[1]); |
|
| 102 | + $this->assertEquals('asd', $children[0]->getName()); |
|
| 103 | + $this->assertEquals('qwerty', $children[1]->getName()); |
|
| 104 | + $this->assertEquals(2, $children[0]->getId()); |
|
| 105 | + $this->assertEquals(3, $children[1]->getId()); |
|
| 106 | + } |
|
| 107 | + |
|
| 108 | + public function testGet(): void { |
|
| 109 | + $manager = $this->createMock(Manager::class); |
|
| 110 | + $view = $this->getRootViewMock(); |
|
| 111 | + $root = $this->getMockBuilder(Root::class) |
|
| 112 | + ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 113 | + ->getMock(); |
|
| 114 | + $root->expects($this->any()) |
|
| 115 | + ->method('getUser') |
|
| 116 | + ->willReturn($this->user); |
|
| 117 | + |
|
| 118 | + $node = new File($root, $view, '/bar/foo/asd'); |
|
| 119 | + $root->method('get') |
|
| 120 | + ->with('/bar/foo/asd') |
|
| 121 | + ->willReturn($node); |
|
| 122 | + |
|
| 123 | + $parentNode = new Folder($root, $view, '/bar/foo'); |
|
| 124 | + self::assertEquals($node, $parentNode->get('asd')); |
|
| 125 | + } |
|
| 126 | + |
|
| 127 | + public function testNodeExists(): void { |
|
| 128 | + $manager = $this->createMock(Manager::class); |
|
| 129 | + $view = $this->getRootViewMock(); |
|
| 130 | + $root = $this->getMockBuilder(Root::class) |
|
| 131 | + ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 132 | + ->getMock(); |
|
| 133 | + $root->expects($this->any()) |
|
| 134 | + ->method('getUser') |
|
| 135 | + ->willReturn($this->user); |
|
| 136 | + |
|
| 137 | + $child = new Folder($root, $view, '/bar/foo/asd'); |
|
| 138 | + |
|
| 139 | + $root->method('get') |
|
| 140 | + ->with('/bar/foo/asd') |
|
| 141 | + ->willReturn($child); |
|
| 142 | + |
|
| 143 | + $node = new Folder($root, $view, '/bar/foo'); |
|
| 144 | + $this->assertTrue($node->nodeExists('asd')); |
|
| 145 | + } |
|
| 146 | + |
|
| 147 | + public function testNodeExistsNotExists(): void { |
|
| 148 | + $manager = $this->createMock(Manager::class); |
|
| 149 | + $view = $this->getRootViewMock(); |
|
| 150 | + $root = $this->getMockBuilder(Root::class) |
|
| 151 | + ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 152 | + ->getMock(); |
|
| 153 | + $root->expects($this->any()) |
|
| 154 | + ->method('getUser') |
|
| 155 | + ->willReturn($this->user); |
|
| 156 | + |
|
| 157 | + $root->method('get') |
|
| 158 | + ->with('/bar/foo/asd') |
|
| 159 | + ->willThrowException(new NotFoundException()); |
|
| 160 | + |
|
| 161 | + $node = new Folder($root, $view, '/bar/foo'); |
|
| 162 | + $this->assertFalse($node->nodeExists('asd')); |
|
| 163 | + } |
|
| 164 | + |
|
| 165 | + public function testNewFolder(): void { |
|
| 166 | + $manager = $this->createMock(Manager::class); |
|
| 167 | + $view = $this->getRootViewMock(); |
|
| 168 | + $root = $this->getMockBuilder(Root::class) |
|
| 169 | + ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 170 | + ->getMock(); |
|
| 171 | + $root->expects($this->any()) |
|
| 172 | + ->method('getUser') |
|
| 173 | + ->willReturn($this->user); |
|
| 174 | + |
|
| 175 | + $view->method('getFileInfo') |
|
| 176 | + ->with('/bar/foo') |
|
| 177 | + ->willReturn($this->getFileInfo(['permissions' => Constants::PERMISSION_ALL])); |
|
| 178 | + |
|
| 179 | + $view->method('mkdir') |
|
| 180 | + ->with('/bar/foo/asd') |
|
| 181 | + ->willReturn(true); |
|
| 182 | + |
|
| 183 | + $node = new Folder($root, $view, '/bar/foo'); |
|
| 184 | + $child = new Folder($root, $view, '/bar/foo/asd', null, $node); |
|
| 185 | + $result = $node->newFolder('asd'); |
|
| 186 | + $this->assertEquals($child, $result); |
|
| 187 | + } |
|
| 188 | + |
|
| 189 | + public function testNewFolderDeepParent(): void { |
|
| 190 | + $manager = $this->createMock(Manager::class); |
|
| 191 | + $view = $this->getRootViewMock(); |
|
| 192 | + $root = $this->getMockBuilder(Root::class) |
|
| 193 | + ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 194 | + ->getMock(); |
|
| 195 | + $root->expects($this->any()) |
|
| 196 | + ->method('getUser') |
|
| 197 | + ->willReturn($this->user); |
|
| 198 | + |
|
| 199 | + $view->method('getFileInfo') |
|
| 200 | + ->with('/foobar') |
|
| 201 | + ->willReturn($this->getFileInfo(['permissions' => Constants::PERMISSION_ALL])); |
|
| 202 | + |
|
| 203 | + $view->method('mkdir') |
|
| 204 | + ->with('/foobar/asd/sdf') |
|
| 205 | + ->willReturn(true); |
|
| 206 | + |
|
| 207 | + $node = new Folder($root, $view, '/foobar'); |
|
| 208 | + $child = new Folder($root, $view, '/foobar/asd/sdf', null, null); |
|
| 209 | + $result = $node->newFolder('asd/sdf'); |
|
| 210 | + $this->assertEquals($child, $result); |
|
| 211 | + } |
|
| 212 | + |
|
| 213 | + |
|
| 214 | + public function testNewFolderNotPermitted(): void { |
|
| 215 | + $this->expectException(NotPermittedException::class); |
|
| 216 | + |
|
| 217 | + $manager = $this->createMock(Manager::class); |
|
| 218 | + $view = $this->getRootViewMock(); |
|
| 219 | + $root = $this->getMockBuilder(Root::class) |
|
| 220 | + ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 221 | + ->getMock(); |
|
| 222 | + $root->method('getUser') |
|
| 223 | + ->willReturn($this->user); |
|
| 224 | + |
|
| 225 | + $view->method('getFileInfo') |
|
| 226 | + ->with('/bar/foo') |
|
| 227 | + ->willReturn($this->getFileInfo(['permissions' => Constants::PERMISSION_READ])); |
|
| 228 | + |
|
| 229 | + $node = new Folder($root, $view, '/bar/foo'); |
|
| 230 | + $node->newFolder('asd'); |
|
| 231 | + } |
|
| 232 | + |
|
| 233 | + public function testNewFile(): void { |
|
| 234 | + $manager = $this->createMock(Manager::class); |
|
| 235 | + $view = $this->getRootViewMock(); |
|
| 236 | + $root = $this->getMockBuilder(Root::class) |
|
| 237 | + ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 238 | + ->getMock(); |
|
| 239 | + $root->expects($this->any()) |
|
| 240 | + ->method('getUser') |
|
| 241 | + ->willReturn($this->user); |
|
| 242 | + |
|
| 243 | + $view->method('getFileInfo') |
|
| 244 | + ->with('/bar/foo') |
|
| 245 | + ->willReturn($this->getFileInfo(['permissions' => Constants::PERMISSION_ALL])); |
|
| 246 | + |
|
| 247 | + $view->method('touch') |
|
| 248 | + ->with('/bar/foo/asd') |
|
| 249 | + ->willReturn(true); |
|
| 250 | + |
|
| 251 | + $node = new Folder($root, $view, '/bar/foo'); |
|
| 252 | + $child = new File($root, $view, '/bar/foo/asd', null, $node); |
|
| 253 | + $result = $node->newFile('asd'); |
|
| 254 | + $this->assertEquals($child, $result); |
|
| 255 | + } |
|
| 256 | + |
|
| 257 | + |
|
| 258 | + public function testNewFileNotPermitted(): void { |
|
| 259 | + $this->expectException(NotPermittedException::class); |
|
| 260 | + |
|
| 261 | + $manager = $this->createMock(Manager::class); |
|
| 262 | + $view = $this->getRootViewMock(); |
|
| 263 | + $root = $this->getMockBuilder(Root::class) |
|
| 264 | + ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 265 | + ->getMock(); |
|
| 266 | + $root->method('getUser') |
|
| 267 | + ->willReturn($this->user); |
|
| 268 | + |
|
| 269 | + $view->method('getFileInfo') |
|
| 270 | + ->with('/bar/foo') |
|
| 271 | + ->willReturn($this->getFileInfo(['permissions' => Constants::PERMISSION_READ])); |
|
| 272 | + |
|
| 273 | + $node = new Folder($root, $view, '/bar/foo'); |
|
| 274 | + $node->newFile('asd'); |
|
| 275 | + } |
|
| 276 | + |
|
| 277 | + public function testGetFreeSpace(): void { |
|
| 278 | + $manager = $this->createMock(Manager::class); |
|
| 279 | + $view = $this->getRootViewMock(); |
|
| 280 | + $root = $this->getMockBuilder(Root::class) |
|
| 281 | + ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 282 | + ->getMock(); |
|
| 283 | + $root->method('getUser') |
|
| 284 | + ->willReturn($this->user); |
|
| 285 | + |
|
| 286 | + $view->method('free_space') |
|
| 287 | + ->with('/bar/foo') |
|
| 288 | + ->willReturn(100); |
|
| 289 | + |
|
| 290 | + $node = new Folder($root, $view, '/bar/foo'); |
|
| 291 | + $this->assertEquals(100, $node->getFreeSpace()); |
|
| 292 | + } |
|
| 293 | + |
|
| 294 | + public function testSearch(): void { |
|
| 295 | + $manager = $this->createMock(Manager::class); |
|
| 296 | + $view = $this->getRootViewMock(); |
|
| 297 | + $root = $this->getMockBuilder(Root::class) |
|
| 298 | + ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 299 | + ->getMock(); |
|
| 300 | + $root->method('getUser') |
|
| 301 | + ->willReturn($this->user); |
|
| 302 | + /** @var Storage\IStorage&MockObject $storage */ |
|
| 303 | + $storage = $this->createMock(IStorage::class); |
|
| 304 | + $storage->method('getId')->willReturn('test::1'); |
|
| 305 | + $cache = new Cache($storage); |
|
| 306 | + |
|
| 307 | + $storage->method('getCache') |
|
| 308 | + ->willReturn($cache); |
|
| 309 | + |
|
| 310 | + $storage->expects($this->atLeastOnce()) |
|
| 311 | + ->method('getOwner') |
|
| 312 | + ->with('qwerty') |
|
| 313 | + ->willReturn(false); |
|
| 314 | + |
|
| 315 | + $mount = $this->createMock(IMountPoint::class); |
|
| 316 | + $mount->expects($this->atLeastOnce()) |
|
| 317 | + ->method('getStorage') |
|
| 318 | + ->willReturn($storage); |
|
| 319 | + $mount->expects($this->atLeastOnce()) |
|
| 320 | + ->method('getInternalPath') |
|
| 321 | + ->willReturn('foo'); |
|
| 322 | + |
|
| 323 | + $cache->insert('', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 324 | + $cache->insert('foo', ['size' => 200, 'mtime' => 55, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 325 | + $cache->insert('foo/qwerty', ['size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain']); |
|
| 326 | + |
|
| 327 | + $root->method('getMountsIn') |
|
| 328 | + ->with('/bar/foo') |
|
| 329 | + ->willReturn([]); |
|
| 330 | + |
|
| 331 | + $root->method('getMount') |
|
| 332 | + ->with('/bar/foo') |
|
| 333 | + ->willReturn($mount); |
|
| 334 | + |
|
| 335 | + $node = new Folder($root, $view, '/bar/foo'); |
|
| 336 | + $result = $node->search('qw'); |
|
| 337 | + $cache->clear(); |
|
| 338 | + $this->assertEquals(1, count($result)); |
|
| 339 | + $this->assertEquals('/bar/foo/qwerty', $result[0]->getPath()); |
|
| 340 | + } |
|
| 341 | + |
|
| 342 | + public function testSearchInRoot(): void { |
|
| 343 | + $manager = $this->createMock(Manager::class); |
|
| 344 | + $view = $this->getRootViewMock(); |
|
| 345 | + $root = $this->getMockBuilder(Root::class) |
|
| 346 | + ->onlyMethods(['getUser', 'getMountsIn', 'getMount']) |
|
| 347 | + ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 348 | + ->getMock(); |
|
| 349 | + $root->expects($this->any()) |
|
| 350 | + ->method('getUser') |
|
| 351 | + ->willReturn($this->user); |
|
| 352 | + /** @var \PHPUnit\Framework\MockObject\MockObject|Storage $storage */ |
|
| 353 | + $storage = $this->createMock(IStorage::class); |
|
| 354 | + $storage->method('getId')->willReturn('test::2'); |
|
| 355 | + $cache = new Cache($storage); |
|
| 356 | + |
|
| 357 | + $mount = $this->createMock(IMountPoint::class); |
|
| 358 | + $mount->method('getStorage') |
|
| 359 | + ->willReturn($storage); |
|
| 360 | + $mount->method('getInternalPath') |
|
| 361 | + ->willReturn('files'); |
|
| 362 | + |
|
| 363 | + $storage->method('getCache') |
|
| 364 | + ->willReturn($cache); |
|
| 365 | + $storage->method('getOwner') |
|
| 366 | + ->willReturn('owner'); |
|
| 367 | + |
|
| 368 | + $cache->insert('', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 369 | + $cache->insert('files', ['size' => 200, 'mtime' => 55, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 370 | + $cache->insert('files/foo', ['size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain']); |
|
| 371 | + |
|
| 372 | + $root->method('getMountsIn') |
|
| 373 | + ->with('') |
|
| 374 | + ->willReturn([]); |
|
| 375 | + |
|
| 376 | + $root->method('getMount') |
|
| 377 | + ->with('') |
|
| 378 | + ->willReturn($mount); |
|
| 379 | + |
|
| 380 | + $result = $root->search('foo'); |
|
| 381 | + $cache->clear(); |
|
| 382 | + $this->assertEquals(1, count($result)); |
|
| 383 | + $this->assertEquals('/foo', $result[0]->getPath()); |
|
| 384 | + } |
|
| 385 | + |
|
| 386 | + public function testSearchInStorageRoot(): void { |
|
| 387 | + $manager = $this->createMock(Manager::class); |
|
| 388 | + $view = $this->getRootViewMock(); |
|
| 389 | + $root = $this->getMockBuilder(Root::class) |
|
| 390 | + ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 391 | + ->getMock(); |
|
| 392 | + $root->method('getUser') |
|
| 393 | + ->willReturn($this->user); |
|
| 394 | + $storage = $this->createMock(IStorage::class); |
|
| 395 | + $storage->method('getId')->willReturn('test::1'); |
|
| 396 | + $cache = new Cache($storage); |
|
| 397 | + |
|
| 398 | + $mount = $this->createMock(IMountPoint::class); |
|
| 399 | + $mount->method('getStorage') |
|
| 400 | + ->willReturn($storage); |
|
| 401 | + $mount->method('getInternalPath') |
|
| 402 | + ->willReturn(''); |
|
| 403 | + |
|
| 404 | + $storage->method('getCache') |
|
| 405 | + ->willReturn($cache); |
|
| 406 | + $storage->method('getOwner') |
|
| 407 | + ->willReturn('owner'); |
|
| 408 | + |
|
| 409 | + $cache->insert('', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 410 | + $cache->insert('foo', ['size' => 200, 'mtime' => 55, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 411 | + $cache->insert('foo/qwerty', ['size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain']); |
|
| 412 | + |
|
| 413 | + |
|
| 414 | + $root->method('getMountsIn') |
|
| 415 | + ->with('/bar') |
|
| 416 | + ->willReturn([]); |
|
| 417 | + |
|
| 418 | + $root->method('getMount') |
|
| 419 | + ->with('/bar') |
|
| 420 | + ->willReturn($mount); |
|
| 421 | + |
|
| 422 | + $node = new Folder($root, $view, '/bar'); |
|
| 423 | + $result = $node->search('qw'); |
|
| 424 | + $cache->clear(); |
|
| 425 | + $this->assertEquals(1, count($result)); |
|
| 426 | + $this->assertEquals('/bar/foo/qwerty', $result[0]->getPath()); |
|
| 427 | + } |
|
| 428 | + |
|
| 429 | + public function testSearchSubStorages(): void { |
|
| 430 | + $manager = $this->createMock(Manager::class); |
|
| 431 | + $view = $this->getRootViewMock(); |
|
| 432 | + $root = $this->getMockBuilder(Root::class) |
|
| 433 | + ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 434 | + ->getMock(); |
|
| 435 | + $root->expects($this->any()) |
|
| 436 | + ->method('getUser') |
|
| 437 | + ->willReturn($this->user); |
|
| 438 | + $storage = $this->createMock(IStorage::class); |
|
| 439 | + $storage->method('getId')->willReturn('test::1'); |
|
| 440 | + $cache = new Cache($storage); |
|
| 441 | + $subStorage = $this->createMock(IStorage::class); |
|
| 442 | + $subStorage->method('getId')->willReturn('test::2'); |
|
| 443 | + $subCache = new Cache($subStorage); |
|
| 444 | + $subMount = $this->getMockBuilder(MountPoint::class)->setConstructorArgs([Temporary::class, ''])->getMock(); |
|
| 445 | + |
|
| 446 | + $mount = $this->createMock(IMountPoint::class); |
|
| 447 | + $mount->method('getStorage') |
|
| 448 | + ->willReturn($storage); |
|
| 449 | + $mount->method('getInternalPath') |
|
| 450 | + ->willReturn('foo'); |
|
| 451 | + |
|
| 452 | + $subMount->method('getStorage') |
|
| 453 | + ->willReturn($subStorage); |
|
| 454 | + |
|
| 455 | + $subMount->method('getMountPoint') |
|
| 456 | + ->willReturn('/bar/foo/bar/'); |
|
| 457 | + |
|
| 458 | + $storage->method('getCache') |
|
| 459 | + ->willReturn($cache); |
|
| 460 | + $storage->method('getOwner') |
|
| 461 | + ->willReturn('owner'); |
|
| 462 | + |
|
| 463 | + $subStorage->method('getCache') |
|
| 464 | + ->willReturn($subCache); |
|
| 465 | + $subStorage->method('getOwner') |
|
| 466 | + ->willReturn('owner'); |
|
| 467 | + |
|
| 468 | + $cache->insert('', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 469 | + $cache->insert('foo', ['size' => 200, 'mtime' => 55, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 470 | + $cache->insert('foo/qwerty', ['size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain']); |
|
| 471 | + |
|
| 472 | + $subCache->insert('', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 473 | + $subCache->insert('asd', ['size' => 200, 'mtime' => 55, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 474 | + $subCache->insert('asd/qwerty', ['size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain']); |
|
| 475 | + |
|
| 476 | + |
|
| 477 | + $root->method('getMountsIn') |
|
| 478 | + ->with('/bar/foo') |
|
| 479 | + ->willReturn([$subMount]); |
|
| 480 | + |
|
| 481 | + $root->method('getMount') |
|
| 482 | + ->with('/bar/foo') |
|
| 483 | + ->willReturn($mount); |
|
| 484 | + |
|
| 485 | + |
|
| 486 | + $node = new Folder($root, $view, '/bar/foo'); |
|
| 487 | + $result = $node->search('qw'); |
|
| 488 | + $cache->clear(); |
|
| 489 | + $subCache->clear(); |
|
| 490 | + $this->assertEquals(2, count($result)); |
|
| 491 | + } |
|
| 492 | + |
|
| 493 | + public function testIsSubNode(): void { |
|
| 494 | + $rootFolderMock = $this->createMock(IRootFolder::class); |
|
| 495 | + $file = new Node($rootFolderMock, $this->view, '/foo/bar'); |
|
| 496 | + $folder = new Folder($rootFolderMock, $this->view, '/foo'); |
|
| 497 | + $this->assertTrue($folder->isSubNode($file)); |
|
| 498 | + $this->assertFalse($folder->isSubNode($folder)); |
|
| 499 | + |
|
| 500 | + $file = new Node($rootFolderMock, $this->view, '/foobar'); |
|
| 501 | + $this->assertFalse($folder->isSubNode($file)); |
|
| 502 | + } |
|
| 503 | + |
|
| 504 | + public function testGetById(): void { |
|
| 505 | + $manager = $this->createMock(Manager::class); |
|
| 506 | + $view = $this->getRootViewMock(); |
|
| 507 | + $root = $this->getMockBuilder(Root::class) |
|
| 508 | + ->onlyMethods(['getMountsIn', 'getMount']) |
|
| 509 | + ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 510 | + ->getMock(); |
|
| 511 | + $storage = $this->createMock(Storage::class); |
|
| 512 | + $mount = new MountPoint($storage, '/bar'); |
|
| 513 | + $storage->method('getId')->willReturn(''); |
|
| 514 | + $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([$storage])->getMock(); |
|
| 515 | + |
|
| 516 | + $fileInfo = new CacheEntry(['path' => 'foo/qwerty', 'mimetype' => 'text/plain'], null); |
|
| 517 | + |
|
| 518 | + $storage->method('getCache') |
|
| 519 | + ->willReturn($cache); |
|
| 520 | + $storage->method('getOwner') |
|
| 521 | + ->willReturn('owner'); |
|
| 522 | + |
|
| 523 | + $this->userMountCache->expects($this->any()) |
|
| 524 | + ->method('getMountsForFileId') |
|
| 525 | + ->with(1) |
|
| 526 | + ->willReturn([new CachedMountInfo( |
|
| 527 | + $this->user, |
|
| 528 | + 1, |
|
| 529 | + 0, |
|
| 530 | + '/bar/', |
|
| 531 | + 'test', |
|
| 532 | + 1, |
|
| 533 | + '' |
|
| 534 | + )]); |
|
| 535 | + |
|
| 536 | + $cache->method('get') |
|
| 537 | + ->with(1) |
|
| 538 | + ->willReturn($fileInfo); |
|
| 539 | + |
|
| 540 | + $root->method('getMountsIn') |
|
| 541 | + ->with('/bar/foo') |
|
| 542 | + ->willReturn([]); |
|
| 543 | + |
|
| 544 | + $manager->method('getMountsByMountProvider') |
|
| 545 | + ->willReturn([$mount]); |
|
| 546 | + |
|
| 547 | + $node = new Folder($root, $view, '/bar/foo'); |
|
| 548 | + $result = $node->getById(1); |
|
| 549 | + $this->assertEquals(1, count($result)); |
|
| 550 | + $this->assertEquals('/bar/foo/qwerty', $result[0]->getPath()); |
|
| 551 | + } |
|
| 552 | + |
|
| 553 | + public function testGetByIdMountRoot(): void { |
|
| 554 | + $manager = $this->createMock(Manager::class); |
|
| 555 | + $view = $this->getRootViewMock(); |
|
| 556 | + $root = $this->getMockBuilder(Root::class) |
|
| 557 | + ->onlyMethods(['getMountsIn', 'getMount']) |
|
| 558 | + ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 559 | + ->getMock(); |
|
| 560 | + $storage = $this->createMock(Storage::class); |
|
| 561 | + $mount = new MountPoint($storage, '/bar'); |
|
| 562 | + $storage->method('getId')->willReturn(''); |
|
| 563 | + $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([$storage])->getMock(); |
|
| 564 | + |
|
| 565 | + $fileInfo = new CacheEntry(['path' => '', 'mimetype' => 'text/plain'], null); |
|
| 566 | + |
|
| 567 | + $storage->method('getCache') |
|
| 568 | + ->willReturn($cache); |
|
| 569 | + $storage->method('getOwner') |
|
| 570 | + ->willReturn('owner'); |
|
| 571 | + |
|
| 572 | + $this->userMountCache->expects($this->any()) |
|
| 573 | + ->method('getMountsForFileId') |
|
| 574 | + ->with(1) |
|
| 575 | + ->willReturn([new CachedMountInfo( |
|
| 576 | + $this->user, |
|
| 577 | + 1, |
|
| 578 | + 0, |
|
| 579 | + '/bar/', |
|
| 580 | + 'test', |
|
| 581 | + 1, |
|
| 582 | + '' |
|
| 583 | + )]); |
|
| 584 | + |
|
| 585 | + $cache->method('get') |
|
| 586 | + ->with(1) |
|
| 587 | + ->willReturn($fileInfo); |
|
| 588 | + |
|
| 589 | + $manager->method('getMountsByMountProvider') |
|
| 590 | + ->willReturn([$mount]); |
|
| 591 | + |
|
| 592 | + $node = new Folder($root, $view, '/bar'); |
|
| 593 | + $result = $node->getById(1); |
|
| 594 | + $this->assertEquals(1, count($result)); |
|
| 595 | + $this->assertEquals('/bar', $result[0]->getPath()); |
|
| 596 | + } |
|
| 597 | + |
|
| 598 | + public function testGetByIdOutsideFolder(): void { |
|
| 599 | + $manager = $this->createMock(Manager::class); |
|
| 600 | + $view = $this->getRootViewMock(); |
|
| 601 | + $root = $this->getMockBuilder(Root::class) |
|
| 602 | + ->onlyMethods(['getMountsIn', 'getMount']) |
|
| 603 | + ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 604 | + ->getMock(); |
|
| 605 | + $storage = $this->createMock(Storage::class); |
|
| 606 | + $mount = new MountPoint($storage, '/bar'); |
|
| 607 | + $storage->method('getId')->willReturn(''); |
|
| 608 | + $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([$storage])->getMock(); |
|
| 609 | + |
|
| 610 | + $fileInfo = new CacheEntry(['path' => 'foobar', 'mimetype' => 'text/plain'], null); |
|
| 611 | + |
|
| 612 | + $storage->method('getCache') |
|
| 613 | + ->willReturn($cache); |
|
| 614 | + $storage->method('getOwner') |
|
| 615 | + ->willReturn('owner'); |
|
| 616 | + |
|
| 617 | + $this->userMountCache->expects($this->any()) |
|
| 618 | + ->method('getMountsForFileId') |
|
| 619 | + ->with(1) |
|
| 620 | + ->willReturn([new CachedMountInfo( |
|
| 621 | + $this->user, |
|
| 622 | + 1, |
|
| 623 | + 0, |
|
| 624 | + '/bar/', |
|
| 625 | + 'test', |
|
| 626 | + 1, |
|
| 627 | + '' |
|
| 628 | + )]); |
|
| 629 | + |
|
| 630 | + $cache->method('get') |
|
| 631 | + ->with(1) |
|
| 632 | + ->willReturn($fileInfo); |
|
| 633 | + |
|
| 634 | + $manager->method('getMountsByMountProvider') |
|
| 635 | + ->willReturn([$mount]); |
|
| 636 | + |
|
| 637 | + $node = new Folder($root, $view, '/bar/foo'); |
|
| 638 | + $result = $node->getById(1); |
|
| 639 | + $this->assertEquals(0, count($result)); |
|
| 640 | + } |
|
| 641 | + |
|
| 642 | + public function testGetByIdMultipleStorages(): void { |
|
| 643 | + $manager = $this->createMock(Manager::class); |
|
| 644 | + $view = $this->getRootViewMock(); |
|
| 645 | + $root = $this->getMockBuilder(Root::class) |
|
| 646 | + ->onlyMethods(['getMountsIn', 'getMount']) |
|
| 647 | + ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 648 | + ->getMock(); |
|
| 649 | + $storage = $this->createMock(Storage::class); |
|
| 650 | + $mount1 = new MountPoint($storage, '/bar'); |
|
| 651 | + $mount2 = new MountPoint($storage, '/bar/foo/asd'); |
|
| 652 | + $storage->method('getId')->willReturn(''); |
|
| 653 | + $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([$storage])->getMock(); |
|
| 654 | + |
|
| 655 | + $fileInfo = new CacheEntry(['path' => 'foo/qwerty', 'mimetype' => 'text/plain'], null); |
|
| 656 | + |
|
| 657 | + $storage->method('getCache') |
|
| 658 | + ->willReturn($cache); |
|
| 659 | + $storage->method('getOwner') |
|
| 660 | + ->willReturn('owner'); |
|
| 661 | + |
|
| 662 | + $this->userMountCache->method('getMountsForFileId') |
|
| 663 | + ->with(1) |
|
| 664 | + ->willReturn([ |
|
| 665 | + new CachedMountInfo( |
|
| 666 | + $this->user, |
|
| 667 | + 1, |
|
| 668 | + 0, |
|
| 669 | + '/bar/', |
|
| 670 | + 'test', |
|
| 671 | + 1, |
|
| 672 | + '' |
|
| 673 | + ), |
|
| 674 | + ]); |
|
| 675 | + |
|
| 676 | + $cache->method('get') |
|
| 677 | + ->with(1) |
|
| 678 | + ->willReturn($fileInfo); |
|
| 679 | + |
|
| 680 | + $manager->method('getMountsByMountProvider') |
|
| 681 | + ->willReturn([$mount1, $mount2]); |
|
| 682 | + |
|
| 683 | + $node = new Folder($root, $view, '/bar/foo'); |
|
| 684 | + $result = $node->getById(1); |
|
| 685 | + $this->assertEquals(2, count($result)); |
|
| 686 | + $this->assertEquals('/bar/foo/qwerty', $result[0]->getPath()); |
|
| 687 | + $this->assertEquals('/bar/foo/asd/foo/qwerty', $result[1]->getPath()); |
|
| 688 | + } |
|
| 689 | + |
|
| 690 | + public static function uniqueNameProvider(): array { |
|
| 691 | + return [ |
|
| 692 | + // input, existing, expected |
|
| 693 | + ['foo', [], 'foo'], |
|
| 694 | + ['foo', ['foo'], 'foo (2)'], |
|
| 695 | + ['foo', ['foo', 'foo (2)'], 'foo (3)'], |
|
| 696 | + ]; |
|
| 697 | + } |
|
| 698 | + |
|
| 699 | + #[\PHPUnit\Framework\Attributes\DataProvider('uniqueNameProvider')] |
|
| 700 | + public function testGetUniqueName($name, $existingFiles, $expected): void { |
|
| 701 | + $manager = $this->createMock(Manager::class); |
|
| 702 | + $folderPath = '/bar/foo'; |
|
| 703 | + $view = $this->getRootViewMock(); |
|
| 704 | + $root = $this->getMockBuilder(Root::class) |
|
| 705 | + ->onlyMethods(['getUser', 'getMountsIn', 'getMount']) |
|
| 706 | + ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 707 | + ->getMock(); |
|
| 708 | + |
|
| 709 | + $view->expects($this->any()) |
|
| 710 | + ->method('file_exists') |
|
| 711 | + ->willReturnCallback(function ($path) use ($existingFiles, $folderPath) { |
|
| 712 | + foreach ($existingFiles as $existing) { |
|
| 713 | + if ($folderPath . '/' . $existing === $path) { |
|
| 714 | + return true; |
|
| 715 | + } |
|
| 716 | + } |
|
| 717 | + return false; |
|
| 718 | + }); |
|
| 719 | + |
|
| 720 | + $node = new Folder($root, $view, $folderPath); |
|
| 721 | + $this->assertEquals($expected, $node->getNonExistingName($name)); |
|
| 722 | + } |
|
| 723 | + |
|
| 724 | + public function testRecent(): void { |
|
| 725 | + $manager = $this->createMock(Manager::class); |
|
| 726 | + $folderPath = '/bar/foo'; |
|
| 727 | + $view = $this->getRootViewMock(); |
|
| 728 | + /** @var \PHPUnit\Framework\MockObject\MockObject|\OC\Files\Node\Root $root */ |
|
| 729 | + $root = $this->getMockBuilder(Root::class) |
|
| 730 | + ->onlyMethods(['getUser', 'getMountsIn', 'getMount']) |
|
| 731 | + ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 732 | + ->getMock(); |
|
| 733 | + /** @var \PHPUnit\Framework\MockObject\MockObject|FileInfo $folderInfo */ |
|
| 734 | + $folderInfo = $this->getMockBuilder(FileInfo::class) |
|
| 735 | + ->disableOriginalConstructor()->getMock(); |
|
| 736 | + |
|
| 737 | + $baseTime = time(); |
|
| 738 | + $storage = new Temporary(); |
|
| 739 | + $mount = new MountPoint($storage, ''); |
|
| 740 | + |
|
| 741 | + $folderInfo->expects($this->any()) |
|
| 742 | + ->method('getMountPoint') |
|
| 743 | + ->willReturn($mount); |
|
| 744 | + $root->method('getMount') |
|
| 745 | + ->willReturn($mount); |
|
| 746 | + $root->method('getMountsIn') |
|
| 747 | + ->willReturn([]); |
|
| 748 | + |
|
| 749 | + $cache = $storage->getCache(); |
|
| 750 | + |
|
| 751 | + $cache->insert('', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 752 | + $cache->insert('bar', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 753 | + $cache->insert('bar/foo', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 754 | + $cache->insert('bar/asd', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 755 | + $id1 = $cache->put('bar/foo/inside.txt', [ |
|
| 756 | + 'storage_mtime' => $baseTime, |
|
| 757 | + 'mtime' => $baseTime, |
|
| 758 | + 'mimetype' => 'text/plain', |
|
| 759 | + 'size' => 3, |
|
| 760 | + 'permissions' => Constants::PERMISSION_ALL, |
|
| 761 | + ]); |
|
| 762 | + $id2 = $cache->put('bar/foo/old.txt', [ |
|
| 763 | + 'storage_mtime' => $baseTime - 100, |
|
| 764 | + 'mtime' => $baseTime - 100, |
|
| 765 | + 'mimetype' => 'text/plain', |
|
| 766 | + 'size' => 3, |
|
| 767 | + 'permissions' => Constants::PERMISSION_READ, |
|
| 768 | + ]); |
|
| 769 | + $cache->put('bar/asd/outside.txt', [ |
|
| 770 | + 'storage_mtime' => $baseTime, |
|
| 771 | + 'mtime' => $baseTime, |
|
| 772 | + 'mimetype' => 'text/plain', |
|
| 773 | + 'size' => 3, |
|
| 774 | + ]); |
|
| 775 | + $id3 = $cache->put('bar/foo/older.txt', [ |
|
| 776 | + 'storage_mtime' => $baseTime - 600, |
|
| 777 | + 'mtime' => $baseTime - 600, |
|
| 778 | + 'mimetype' => 'text/plain', |
|
| 779 | + 'size' => 3, |
|
| 780 | + 'permissions' => Constants::PERMISSION_ALL, |
|
| 781 | + ]); |
|
| 782 | + |
|
| 783 | + $node = new Folder($root, $view, $folderPath, $folderInfo); |
|
| 784 | + |
|
| 785 | + |
|
| 786 | + $nodes = $node->getRecent(5); |
|
| 787 | + $ids = array_map(function (Node $node) { |
|
| 788 | + return (int)$node->getId(); |
|
| 789 | + }, $nodes); |
|
| 790 | + $this->assertEquals([$id1, $id2, $id3], $ids); |
|
| 791 | + } |
|
| 792 | + |
|
| 793 | + public function testRecentFolder(): void { |
|
| 794 | + $manager = $this->createMock(Manager::class); |
|
| 795 | + $folderPath = '/bar/foo'; |
|
| 796 | + $view = $this->getRootViewMock(); |
|
| 797 | + /** @var \PHPUnit\Framework\MockObject\MockObject|\OC\Files\Node\Root $root */ |
|
| 798 | + $root = $this->getMockBuilder(Root::class) |
|
| 799 | + ->onlyMethods(['getUser', 'getMountsIn', 'getMount']) |
|
| 800 | + ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 801 | + ->getMock(); |
|
| 802 | + /** @var \PHPUnit\Framework\MockObject\MockObject|FileInfo $folderInfo */ |
|
| 803 | + $folderInfo = $this->getMockBuilder(FileInfo::class) |
|
| 804 | + ->disableOriginalConstructor()->getMock(); |
|
| 805 | + |
|
| 806 | + $baseTime = time(); |
|
| 807 | + $storage = new Temporary(); |
|
| 808 | + $mount = new MountPoint($storage, ''); |
|
| 809 | + |
|
| 810 | + $folderInfo->expects($this->any()) |
|
| 811 | + ->method('getMountPoint') |
|
| 812 | + ->willReturn($mount); |
|
| 813 | + |
|
| 814 | + $root->method('getMount') |
|
| 815 | + ->willReturn($mount); |
|
| 816 | + $root->method('getMountsIn') |
|
| 817 | + ->willReturn([]); |
|
| 818 | + |
|
| 819 | + $cache = $storage->getCache(); |
|
| 820 | + |
|
| 821 | + $cache->insert('', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 822 | + $cache->insert('bar', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 823 | + $cache->insert('bar/foo', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 824 | + $id1 = $cache->put('bar/foo/folder', [ |
|
| 825 | + 'storage_mtime' => $baseTime, |
|
| 826 | + 'mtime' => $baseTime, |
|
| 827 | + 'mimetype' => \OCP\Files\FileInfo::MIMETYPE_FOLDER, |
|
| 828 | + 'size' => 3, |
|
| 829 | + 'permissions' => 0, |
|
| 830 | + ]); |
|
| 831 | + $id2 = $cache->put('bar/foo/folder/bar.txt', [ |
|
| 832 | + 'storage_mtime' => $baseTime, |
|
| 833 | + 'mtime' => $baseTime, |
|
| 834 | + 'mimetype' => 'text/plain', |
|
| 835 | + 'size' => 3, |
|
| 836 | + 'parent' => $id1, |
|
| 837 | + 'permissions' => Constants::PERMISSION_ALL, |
|
| 838 | + ]); |
|
| 839 | + $id3 = $cache->put('bar/foo/folder/asd.txt', [ |
|
| 840 | + 'storage_mtime' => $baseTime - 100, |
|
| 841 | + 'mtime' => $baseTime - 100, |
|
| 842 | + 'mimetype' => 'text/plain', |
|
| 843 | + 'size' => 3, |
|
| 844 | + 'parent' => $id1, |
|
| 845 | + 'permissions' => Constants::PERMISSION_ALL, |
|
| 846 | + ]); |
|
| 847 | + |
|
| 848 | + $node = new Folder($root, $view, $folderPath, $folderInfo); |
|
| 849 | + |
|
| 850 | + |
|
| 851 | + $nodes = $node->getRecent(5); |
|
| 852 | + $ids = array_map(function (Node $node) { |
|
| 853 | + return (int)$node->getId(); |
|
| 854 | + }, $nodes); |
|
| 855 | + $this->assertEquals([$id2, $id3], $ids); |
|
| 856 | + $this->assertEquals($baseTime, $nodes[0]->getMTime()); |
|
| 857 | + $this->assertEquals($baseTime - 100, $nodes[1]->getMTime()); |
|
| 858 | + } |
|
| 859 | + |
|
| 860 | + public function testRecentJail(): void { |
|
| 861 | + $manager = $this->createMock(Manager::class); |
|
| 862 | + $folderPath = '/bar/foo'; |
|
| 863 | + $view = $this->getRootViewMock(); |
|
| 864 | + /** @var \PHPUnit\Framework\MockObject\MockObject|\OC\Files\Node\Root $root */ |
|
| 865 | + $root = $this->getMockBuilder(Root::class) |
|
| 866 | + ->onlyMethods(['getUser', 'getMountsIn', 'getMount']) |
|
| 867 | + ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 868 | + ->getMock(); |
|
| 869 | + /** @var \PHPUnit\Framework\MockObject\MockObject|FileInfo $folderInfo */ |
|
| 870 | + $folderInfo = $this->getMockBuilder(FileInfo::class) |
|
| 871 | + ->disableOriginalConstructor()->getMock(); |
|
| 872 | + |
|
| 873 | + $baseTime = time(); |
|
| 874 | + $storage = new Temporary(); |
|
| 875 | + $jail = new Jail([ |
|
| 876 | + 'storage' => $storage, |
|
| 877 | + 'root' => 'folder', |
|
| 878 | + ]); |
|
| 879 | + $mount = new MountPoint($jail, '/bar/foo'); |
|
| 880 | + |
|
| 881 | + $folderInfo->expects($this->any()) |
|
| 882 | + ->method('getMountPoint') |
|
| 883 | + ->willReturn($mount); |
|
| 884 | + $root->method('getMount') |
|
| 885 | + ->willReturn($mount); |
|
| 886 | + $root->method('getMountsIn') |
|
| 887 | + ->willReturn([]); |
|
| 888 | + |
|
| 889 | + $cache = $storage->getCache(); |
|
| 890 | + |
|
| 891 | + $cache->insert('', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 892 | + $cache->insert('folder', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 893 | + $id1 = $cache->put('folder/inside.txt', [ |
|
| 894 | + 'storage_mtime' => $baseTime, |
|
| 895 | + 'mtime' => $baseTime, |
|
| 896 | + 'mimetype' => 'text/plain', |
|
| 897 | + 'size' => 3, |
|
| 898 | + 'permissions' => Constants::PERMISSION_ALL, |
|
| 899 | + ]); |
|
| 900 | + |
|
| 901 | + $cache->put('outside.txt', [ |
|
| 902 | + 'storage_mtime' => $baseTime - 100, |
|
| 903 | + 'mtime' => $baseTime - 100, |
|
| 904 | + 'mimetype' => 'text/plain', |
|
| 905 | + 'size' => 3, |
|
| 906 | + ]); |
|
| 907 | + |
|
| 908 | + $node = new Folder($root, $view, $folderPath, $folderInfo); |
|
| 909 | + |
|
| 910 | + $nodes = $node->getRecent(5); |
|
| 911 | + $ids = array_map(function (Node $node) { |
|
| 912 | + return (int)$node->getId(); |
|
| 913 | + }, $nodes); |
|
| 914 | + $this->assertEquals([$id1], $ids); |
|
| 915 | + } |
|
| 916 | + |
|
| 917 | + public static function offsetLimitProvider(): array { |
|
| 918 | + return [ |
|
| 919 | + [0, 10, ['/bar/foo/foo1', '/bar/foo/foo2', '/bar/foo/foo3', '/bar/foo/foo4', '/bar/foo/sub1/foo5', '/bar/foo/sub1/foo6', '/bar/foo/sub2/foo7', '/bar/foo/sub2/foo8'], []], |
|
| 920 | + [0, 5, ['/bar/foo/foo1', '/bar/foo/foo2', '/bar/foo/foo3', '/bar/foo/foo4', '/bar/foo/sub1/foo5'], []], |
|
| 921 | + [0, 2, ['/bar/foo/foo1', '/bar/foo/foo2'], []], |
|
| 922 | + [3, 2, ['/bar/foo/foo4', '/bar/foo/sub1/foo5'], []], |
|
| 923 | + [3, 5, ['/bar/foo/foo4', '/bar/foo/sub1/foo5', '/bar/foo/sub1/foo6', '/bar/foo/sub2/foo7', '/bar/foo/sub2/foo8'], []], |
|
| 924 | + [5, 2, ['/bar/foo/sub1/foo6', '/bar/foo/sub2/foo7'], []], |
|
| 925 | + [6, 2, ['/bar/foo/sub2/foo7', '/bar/foo/sub2/foo8'], []], |
|
| 926 | + [7, 2, ['/bar/foo/sub2/foo8'], []], |
|
| 927 | + [10, 2, [], []], |
|
| 928 | + [0, 5, ['/bar/foo/sub2/foo7', '/bar/foo/foo1', '/bar/foo/sub1/foo5', '/bar/foo/foo2', '/bar/foo/foo3'], [new SearchOrder(ISearchOrder::DIRECTION_ASCENDING, 'mtime')]], |
|
| 929 | + [3, 2, ['/bar/foo/foo2', '/bar/foo/foo3'], [new SearchOrder(ISearchOrder::DIRECTION_ASCENDING, 'mtime')]], |
|
| 930 | + [0, 5, ['/bar/foo/sub1/foo5', '/bar/foo/sub1/foo6', '/bar/foo/sub2/foo7', '/bar/foo/foo1', '/bar/foo/foo2'], [ |
|
| 931 | + new SearchOrder(ISearchOrder::DIRECTION_DESCENDING, 'size'), |
|
| 932 | + new SearchOrder(ISearchOrder::DIRECTION_ASCENDING, 'mtime') |
|
| 933 | + ]], |
|
| 934 | + ]; |
|
| 935 | + } |
|
| 936 | + |
|
| 937 | + /** |
|
| 938 | + * @param int $offset |
|
| 939 | + * @param int $limit |
|
| 940 | + * @param string[] $expectedPaths |
|
| 941 | + * @param ISearchOrder[] $ordering |
|
| 942 | + * @throws NotFoundException |
|
| 943 | + * @throws InvalidPathException |
|
| 944 | + */ |
|
| 945 | + #[\PHPUnit\Framework\Attributes\DataProvider('offsetLimitProvider')] |
|
| 946 | + public function testSearchSubStoragesLimitOffset(int $offset, int $limit, array $expectedPaths, array $ordering): void { |
|
| 947 | + if (!$ordering) { |
|
| 948 | + $ordering = [new SearchOrder(ISearchOrder::DIRECTION_ASCENDING, 'fileid')]; |
|
| 949 | + } |
|
| 950 | + |
|
| 951 | + $manager = $this->createMock(Manager::class); |
|
| 952 | + $view = $this->getRootViewMock(); |
|
| 953 | + $root = $this->getMockBuilder(Root::class) |
|
| 954 | + ->setConstructorArgs([$manager, $view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory, $this->appConfig]) |
|
| 955 | + ->getMock(); |
|
| 956 | + $root->expects($this->any()) |
|
| 957 | + ->method('getUser') |
|
| 958 | + ->willReturn($this->user); |
|
| 959 | + $storage = $this->createMock(IStorage::class); |
|
| 960 | + $storage->method('getId')->willReturn('test::1'); |
|
| 961 | + $cache = new Cache($storage); |
|
| 962 | + $subStorage1 = $this->createMock(IStorage::class); |
|
| 963 | + $subStorage1->method('getId')->willReturn('test::2'); |
|
| 964 | + $subCache1 = new Cache($subStorage1); |
|
| 965 | + $subMount1 = $this->getMockBuilder(MountPoint::class)->setConstructorArgs([Temporary::class, ''])->getMock(); |
|
| 966 | + $subStorage2 = $this->createMock(IStorage::class); |
|
| 967 | + $subStorage2->method('getId')->willReturn('test::3'); |
|
| 968 | + $subCache2 = new Cache($subStorage2); |
|
| 969 | + $subMount2 = $this->getMockBuilder(MountPoint::class)->setConstructorArgs([Temporary::class, ''])->getMock(); |
|
| 970 | + |
|
| 971 | + $mount = $this->createMock(IMountPoint::class); |
|
| 972 | + $mount->method('getStorage') |
|
| 973 | + ->willReturn($storage); |
|
| 974 | + $mount->method('getInternalPath') |
|
| 975 | + ->willReturn('foo'); |
|
| 976 | + |
|
| 977 | + $subMount1->method('getStorage') |
|
| 978 | + ->willReturn($subStorage1); |
|
| 979 | + |
|
| 980 | + $subMount1->method('getMountPoint') |
|
| 981 | + ->willReturn('/bar/foo/sub1/'); |
|
| 982 | + |
|
| 983 | + $storage->method('getCache') |
|
| 984 | + ->willReturn($cache); |
|
| 985 | + $storage->method('getOwner') |
|
| 986 | + ->willReturn('owner'); |
|
| 987 | + |
|
| 988 | + $subStorage1->method('getCache') |
|
| 989 | + ->willReturn($subCache1); |
|
| 990 | + $subStorage1->method('getOwner') |
|
| 991 | + ->willReturn('owner'); |
|
| 992 | + |
|
| 993 | + $subMount2->method('getStorage') |
|
| 994 | + ->willReturn($subStorage2); |
|
| 995 | + |
|
| 996 | + $subMount2->method('getMountPoint') |
|
| 997 | + ->willReturn('/bar/foo/sub2/'); |
|
| 998 | + |
|
| 999 | + $subStorage2->method('getCache') |
|
| 1000 | + ->willReturn($subCache2); |
|
| 1001 | + $subStorage2->method('getOwner') |
|
| 1002 | + ->willReturn('owner'); |
|
| 1003 | + |
|
| 1004 | + |
|
| 1005 | + $cache->insert('', ['size' => 0, 'mtime' => 10, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 1006 | + $cache->insert('foo', ['size' => 0, 'mtime' => 10, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 1007 | + $cache->insert('foo/foo1', ['size' => 200, 'mtime' => 10, 'mimetype' => 'text/plain']); |
|
| 1008 | + $cache->insert('foo/foo2', ['size' => 200, 'mtime' => 20, 'mimetype' => 'text/plain']); |
|
| 1009 | + $cache->insert('foo/foo3', ['size' => 200, 'mtime' => 30, 'mimetype' => 'text/plain']); |
|
| 1010 | + $cache->insert('foo/foo4', ['size' => 200, 'mtime' => 40, 'mimetype' => 'text/plain']); |
|
| 1011 | + |
|
| 1012 | + $subCache1->insert('', ['size' => 0, 'mtime' => 10, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 1013 | + $subCache1->insert('foo5', ['size' => 300, 'mtime' => 15, 'mimetype' => 'text/plain']); |
|
| 1014 | + $subCache1->insert('foo6', ['size' => 300, 'mtime' => 50, 'mimetype' => 'text/plain']); |
|
| 1015 | + |
|
| 1016 | + $subCache2->insert('', ['size' => 0, 'mtime' => 10, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |
|
| 1017 | + $subCache2->insert('foo7', ['size' => 200, 'mtime' => 5, 'mimetype' => 'text/plain']); |
|
| 1018 | + $subCache2->insert('foo8', ['size' => 200, 'mtime' => 60, 'mimetype' => 'text/plain']); |
|
| 1019 | + |
|
| 1020 | + $root->method('getMountsIn') |
|
| 1021 | + ->with('/bar/foo') |
|
| 1022 | + ->willReturn([$subMount1, $subMount2]); |
|
| 1023 | + |
|
| 1024 | + $root->method('getMount') |
|
| 1025 | + ->with('/bar/foo') |
|
| 1026 | + ->willReturn($mount); |
|
| 1027 | + |
|
| 1028 | + $node = new Folder($root, $view, '/bar/foo'); |
|
| 1029 | + $comparison = new SearchComparison(ISearchComparison::COMPARE_LIKE, 'name', '%foo%'); |
|
| 1030 | + $operator = new SearchBinaryOperator(ISearchBinaryOperator::OPERATOR_AND, [ |
|
| 1031 | + $comparison, |
|
| 1032 | + new SearchBinaryOperator(ISearchBinaryOperator::OPERATOR_NOT, [new SearchComparison(ISearchComparison::COMPARE_EQUAL, 'mimetype', ICacheEntry::DIRECTORY_MIMETYPE)]), |
|
| 1033 | + ]); |
|
| 1034 | + $query = new SearchQuery($operator, $limit, $offset, $ordering); |
|
| 1035 | + $result = $node->search($query); |
|
| 1036 | + $cache->clear(); |
|
| 1037 | + $subCache1->clear(); |
|
| 1038 | + $subCache2->clear(); |
|
| 1039 | + $ids = array_map(function (Node $info) { |
|
| 1040 | + return $info->getPath(); |
|
| 1041 | + }, $result); |
|
| 1042 | + $this->assertEquals($expectedPaths, $ids); |
|
| 1043 | + } |
|
| 1044 | 1044 | } |