diff options
author | Joas Schilling <coding@schilljs.com> | 2023-02-02 18:04:20 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-02-02 18:06:31 +0100 |
commit | 47880b143d663678f25887eff7fc023a6fd13206 (patch) | |
tree | 36b2fefaeccb5b52359a4763cf7f9e142f3436be /tests | |
parent | 39f202581bc72209f2f9c138701281267ba30d39 (diff) | |
download | nextcloud-server-47880b143d663678f25887eff7fc023a6fd13206.tar.gz nextcloud-server-47880b143d663678f25887eff7fc023a6fd13206.zip |
Remove failing test that works with mocks only anyway
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Encryption/UtilTest.php | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/tests/lib/Encryption/UtilTest.php b/tests/lib/Encryption/UtilTest.php index c2bc4ac55bd..8d800cf6f34 100644 --- a/tests/lib/Encryption/UtilTest.php +++ b/tests/lib/Encryption/UtilTest.php @@ -4,8 +4,6 @@ namespace Test\Encryption; use OC\Encryption\Util; use OC\Files\View; -use OCA\Files_External\Lib\StorageConfig; -use OCA\Files_External\Service\GlobalStoragesService; use OCP\Encryption\IEncryptionModule; use OCP\IConfig; use OCP\IGroupManager; @@ -180,43 +178,4 @@ class UtilTest extends TestCase { ['/foo/test.txt.ocTransferId7567.part', '/foo/test.txt'], ]; } - - public function dataTestIsSystemWideMountPoint() { - return [ - [false, 'non-matching mount point name', [], [], '/mp_another'], - [true, 'applicable to all', [], []], - [true, 'applicable to user directly', ['user1'], []], - [true, 'applicable to group directly', [], ['group1']], - [false, 'non-applicable to current user', ['user2'], []], - [false, 'non-applicable to current user\'s group', [], ['group2']], - [true, 'mount point without leading slash', [], [], 'mp'], - ]; - } - - /** - * @dataProvider dataTestIsSystemWideMountPoint - */ - public function testIsSystemWideMountPoint($expectedResult, $expectationText, $applicableUsers, $applicableGroups, $mountPointName = '/mp') { - $this->groupManager->method('isInGroup') - ->will($this->returnValueMap([ - ['user1', 'group1', true], // user is only in group1 - ['user1', 'group2', false], - ])); - - $storages = []; - - $storageConfig = $this->createMock(StorageConfig::class); - $storageConfig->method('getMountPoint')->willReturn($mountPointName); - $storageConfig->method('getApplicableUsers')->willReturn($applicableUsers); - $storageConfig->method('getApplicableGroups')->willReturn($applicableGroups); - $storages[] = $storageConfig; - - $storagesServiceMock = $this->createMock(GlobalStoragesService::class); - $storagesServiceMock->expects($this->atLeastOnce())->method('getAllStorages') - ->willReturn($storages); - - $this->overwriteService(GlobalStoragesService::class, $storagesServiceMock); - - $this->assertEquals($expectedResult, $this->util->isSystemWideMountPoint('/files/mp', 'user1'), 'Test case: ' . $expectationText); - } } |