diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-07-16 12:38:41 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-07-16 12:38:41 +0200 |
commit | 5a33c9c360dd194beb68e2949d08428fdf95b9df (patch) | |
tree | 0aba5a82722aa9e8d57501f9f77b9c4fd5dcd5ee /apps | |
parent | 4d74aa09bf7102a1104549b08c6bebe2382ec0cd (diff) | |
download | nextcloud-server-5a33c9c360dd194beb68e2949d08428fdf95b9df.tar.gz nextcloud-server-5a33c9c360dd194beb68e2949d08428fdf95b9df.zip |
Removed legacy encryption tests
Diffstat (limited to 'apps')
-rwxr-xr-x | apps/files_encryption/tests/util.php | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/apps/files_encryption/tests/util.php b/apps/files_encryption/tests/util.php index 0422de61ed3..3142b83c5a6 100755 --- a/apps/files_encryption/tests/util.php +++ b/apps/files_encryption/tests/util.php @@ -200,36 +200,6 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { /** * @medium - * test checking whether account is not ready for encryption, - */ - function testIsLegacyUser() { - $this->markTestSkipped('This test fails - could this be caused by the removal of the legacy code of encryption?'); - - \Test_Encryption_Util::loginHelper(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER); - - $userView = new \OC\Files\View('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER); - - // Disable encryption proxy to prevent recursive calls - $proxyStatus = \OC_FileProxy::$enabled; - \OC_FileProxy::$enabled = false; - - $encryptionKeyContent = file_get_contents($this->legacyEncryptedDataKey); - $userView->file_put_contents('/encryption.key', $encryptionKeyContent); - - \OC_FileProxy::$enabled = $proxyStatus; - - $params['uid'] = \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER; - $params['password'] = \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER; - - $this->setMigrationStatus(0, \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER); - - $this->assertTrue(OCA\Encryption\Hooks::login($params)); - - $this->assertEquals($this->legacyKey, \OC::$session->get('legacyKey')); - } - - /** - * @medium */ function testRecoveryEnabledForUser() { @@ -488,60 +458,6 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { } /** - * @large - */ - function testEncryptLegacyFiles() { - $this->markTestSkipped('This test fails - could this be caused by the removal of the legacy code of encryption?'); - - \Test_Encryption_Util::loginHelper(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER); - - $userView = new \OC\Files\View('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER); - $view = new \OC\Files\View('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER . '/files'); - - // Disable encryption proxy to prevent recursive calls - $proxyStatus = \OC_FileProxy::$enabled; - \OC_FileProxy::$enabled = false; - - $encryptionKeyContent = file_get_contents($this->legacyEncryptedDataKey); - $userView->file_put_contents('/encryption.key', $encryptionKeyContent); - - $legacyEncryptedData = file_get_contents($this->legacyEncryptedData); - $view->mkdir('/test/'); - $view->mkdir('/test/subtest/'); - $view->file_put_contents('/test/subtest/legacy-encrypted-text.txt', $legacyEncryptedData); - - $fileInfo = $view->getFileInfo('/test/subtest/legacy-encrypted-text.txt'); - $fileInfo['encrypted'] = true; - $view->putFileInfo('/test/subtest/legacy-encrypted-text.txt', $fileInfo); - - \OC_FileProxy::$enabled = $proxyStatus; - - $params['uid'] = \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER; - $params['password'] = \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER; - - $util = new Encryption\Util($this->view, \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER); - $this->setMigrationStatus(0, \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER); - - $this->assertTrue(OCA\Encryption\Hooks::login($params)); - - $this->assertEquals($this->legacyKey, \OC::$session->get('legacyKey')); - - $files = $util->findEncFiles('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER . '/files/'); - - $this->assertTrue(is_array($files)); - - $found = false; - foreach ($files['encrypted'] as $encryptedFile) { - if ($encryptedFile['name'] === 'legacy-encrypted-text.txt') { - $found = true; - break; - } - } - - $this->assertTrue($found); - } - - /** * @param string $user * @param bool $create * @param bool $password |