diff options
author | Florin Peter <github@florin-peter.de> | 2013-05-01 01:38:06 +0200 |
---|---|---|
committer | Florin Peter <github@florin-peter.de> | 2013-05-01 01:38:06 +0200 |
commit | 3c100af1329c1c101f38f23f2d74710954387fdf (patch) | |
tree | 9b8dff5ea23da3ca6ed6984f8cec741143e42833 /apps/files_encryption/tests | |
parent | 5deba29bdfedc3ee2babece9eafff0bb709cd90c (diff) | |
download | nextcloud-server-3c100af1329c1c101f38f23f2d74710954387fdf.tar.gz nextcloud-server-3c100af1329c1c101f38f23f2d74710954387fdf.zip |
revert changes to fbbc76f281f50afa3072d99e4e0d413df835b3d3 because master is very unstable right now
Diffstat (limited to 'apps/files_encryption/tests')
-rwxr-xr-x | apps/files_encryption/tests/crypt.php | 9 | ||||
-rw-r--r-- | apps/files_encryption/tests/keymanager.php | 7 | ||||
-rw-r--r-- | apps/files_encryption/tests/stream.php | 2 | ||||
-rwxr-xr-x | apps/files_encryption/tests/util.php | 9 |
4 files changed, 8 insertions, 19 deletions
diff --git a/apps/files_encryption/tests/crypt.php b/apps/files_encryption/tests/crypt.php index 4a85048ba43..7f9572f4266 100755 --- a/apps/files_encryption/tests/crypt.php +++ b/apps/files_encryption/tests/crypt.php @@ -21,6 +21,7 @@ use OCA\Encryption; // This has to go here because otherwise session errors arise, and the private // encryption key needs to be saved in the session +\OC_User::login( 'admin', 'admin' ); /** * @note It would be better to use Mockery here for mocking out the session @@ -36,7 +37,7 @@ class Test_Crypt extends \PHPUnit_Framework_TestCase { // reset backend \OC_User::useBackend('database'); - // set content for encrypting / decrypting in tests + // set content for encrypting / decrypting in tests $this->dataLong = file_get_contents( realpath( dirname(__FILE__).'/../lib/crypt.php' ) ); $this->dataShort = 'hats'; $this->dataUrl = realpath( dirname(__FILE__).'/../lib/crypt.php' ); @@ -59,17 +60,13 @@ class Test_Crypt extends \PHPUnit_Framework_TestCase { \OC\Files\Filesystem::init($this->userId, '/'); \OC\Files\Filesystem::mount( 'OC_Filestorage_Local', array('datadir' => $this->dataDir), '/' ); - - $params['uid'] = $this->userId; - $params['password'] = $this->pass; - OCA\Encryption\Hooks::login($params); } function tearDown() { } - function testGenerateKey() { + function testGenerateKey() { # TODO: use more accurate (larger) string length for test confirmation diff --git a/apps/files_encryption/tests/keymanager.php b/apps/files_encryption/tests/keymanager.php index 33ca29997be..81034be54b1 100644 --- a/apps/files_encryption/tests/keymanager.php +++ b/apps/files_encryption/tests/keymanager.php @@ -19,7 +19,7 @@ use OCA\Encryption; // This has to go here because otherwise session errors arise, and the private // encryption key needs to be saved in the session -//\OC_User::login( 'admin', 'admin' ); +\OC_User::login( 'admin', 'admin' ); class Test_Keymanager extends \PHPUnit_Framework_TestCase { @@ -52,10 +52,7 @@ class Test_Keymanager extends \PHPUnit_Framework_TestCase { \OC\Files\Filesystem::init( $this->userId, '/' ); \OC\Files\Filesystem::mount( 'OC_Filestorage_Local', array('datadir' => $this->dataDir), '/' ); - - $params['uid'] = $this->userId; - $params['password'] = $this->pass; - OCA\Encryption\Hooks::login($params); + } function tearDown(){ diff --git a/apps/files_encryption/tests/stream.php b/apps/files_encryption/tests/stream.php index 633cc9e4fce..ba82ac80eab 100644 --- a/apps/files_encryption/tests/stream.php +++ b/apps/files_encryption/tests/stream.php @@ -1,4 +1,4 @@ -<?php +// <?php // /** // * Copyright (c) 2012 Robin Appelman <icewind@owncloud.com> // * This file is licensed under the Affero General Public License version 3 or diff --git a/apps/files_encryption/tests/util.php b/apps/files_encryption/tests/util.php index e3ec0860fa5..0659b468a37 100755 --- a/apps/files_encryption/tests/util.php +++ b/apps/files_encryption/tests/util.php @@ -24,6 +24,8 @@ $loader->register(); use \Mockery as m; use OCA\Encryption; +\OC_User::login( 'admin', 'admin' ); + class Test_Enc_Util extends \PHPUnit_Framework_TestCase { function setUp() { @@ -60,10 +62,6 @@ class Test_Enc_Util extends \PHPUnit_Framework_TestCase { \OC\Files\Filesystem::init( $this->userId, '/' ); \OC\Files\Filesystem::mount( 'OC_Filestorage_Local', array('datadir' => $this->dataDir), '/' ); - $params['uid'] = $this->userId; - $params['password'] = $this->pass; - OCA\Encryption\Hooks::login($params); - $mockView = m::mock('OC_FilesystemView'); $this->util = new Encryption\Util( $mockView, $this->userId ); @@ -77,9 +75,6 @@ class Test_Enc_Util extends \PHPUnit_Framework_TestCase { /** * @brief test that paths set during User construction are correct - * - * - * */ function testKeyPaths() { |