diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-06-12 14:00:53 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-06-12 14:00:53 +0200 |
commit | df78085171b8c059bfa12f4b60b9f9433529512a (patch) | |
tree | eac67d32a2e201a05c69e34fc5cfdf870544bea6 /apps/files_encryption | |
parent | c78a90fd54c790a21c9ba4d8dcf86a68ebef0edd (diff) | |
download | nextcloud-server-df78085171b8c059bfa12f4b60b9f9433529512a.tar.gz nextcloud-server-df78085171b8c059bfa12f4b60b9f9433529512a.zip |
adapt test to the code changes
Diffstat (limited to 'apps/files_encryption')
-rwxr-xr-x | apps/files_encryption/tests/util.php | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/apps/files_encryption/tests/util.php b/apps/files_encryption/tests/util.php index 0dc452a41c8..93b3d111e44 100755 --- a/apps/files_encryption/tests/util.php +++ b/apps/files_encryption/tests/util.php @@ -178,8 +178,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { $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); - $util->setMigrationStatus(0); + $this->setMigrationStatus(0, \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER); $this->assertTrue(OCA\Encryption\Hooks::login($params)); @@ -269,7 +268,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { $params['password'] = \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER; $util = new Encryption\Util($this->view, \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER); - $util->setMigrationStatus(0); + $this->setMigrationStatus(0, \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER); $this->assertTrue(OCA\Encryption\Hooks::login($params)); @@ -314,4 +313,20 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { $params['password'] = $password; OCA\Encryption\Hooks::login($params); } + + private function setMigrationStatus($status, $user) { + $sql = 'UPDATE `*PREFIX*encryption` SET `migration_status` = ? WHERE `uid` = ?'; + $args = array( + $status, + $user + ); + + $query = \OCP\DB::prepare($sql); + if ($query->execute($args)) { + return true; + } else { + return false; + } + } + } |