diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-12-09 12:56:57 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-12-09 12:56:57 +0100 |
commit | 26861a98c59c39901b9127831b7edf0c0a3eff40 (patch) | |
tree | 47d8331ea605e3d37c27f4dcdd14b791220cba92 /apps/files_encryption/tests/migration.php | |
parent | e61f24f2aae6163e09aa4462c9e2de4d592deb1a (diff) | |
parent | b85e34c1da075ad551321541a4e75d0d3a7015a5 (diff) | |
download | nextcloud-server-26861a98c59c39901b9127831b7edf0c0a3eff40.tar.gz nextcloud-server-26861a98c59c39901b9127831b7edf0c0a3eff40.zip |
Merge pull request #12568 from owncloud/autoload-encryption-classes
Fix namespaces of encryption classes and encryption tests
Diffstat (limited to 'apps/files_encryption/tests/migration.php')
-rw-r--r-- | apps/files_encryption/tests/migration.php | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/apps/files_encryption/tests/migration.php b/apps/files_encryption/tests/migration.php index 21c4e354c29..f0d1ba202ed 100644 --- a/apps/files_encryption/tests/migration.php +++ b/apps/files_encryption/tests/migration.php @@ -21,15 +21,15 @@ * */ -use OCA\Encryption; -use OCA\Files_Encryption\Migration; +namespace OCA\Files_Encryption\Tests; -class Test_Migration extends \OCA\Files_Encryption\Tests\TestCase { +class Migration extends TestCase { const TEST_ENCRYPTION_MIGRATION_USER1='test_encryption_user1'; const TEST_ENCRYPTION_MIGRATION_USER2='test_encryption_user2'; const TEST_ENCRYPTION_MIGRATION_USER3='test_encryption_user3'; + /** @var \OC\Files\View */ private $view; private $public_share_key_id; private $recovery_key_id; @@ -49,8 +49,8 @@ class Test_Migration extends \OCA\Files_Encryption\Tests\TestCase { } protected function tearDown() { - if (OC_DB::tableExists('encryption_test')) { - OC_DB::dropTable('encryption_test'); + if (\OC_DB::tableExists('encryption_test')) { + \OC_DB::dropTable('encryption_test'); } $this->assertTableNotExist('encryption_test'); @@ -60,10 +60,10 @@ class Test_Migration extends \OCA\Files_Encryption\Tests\TestCase { public function setUp() { $this->loginHelper(self::TEST_ENCRYPTION_MIGRATION_USER1); $this->view = new \OC\Files\View(); - $this->public_share_key_id = Encryption\Helper::getPublicShareKeyId(); - $this->recovery_key_id = Encryption\Helper::getRecoveryKeyId(); - if (OC_DB::tableExists('encryption_test')) { - OC_DB::dropTable('encryption_test'); + $this->public_share_key_id = \OCA\Files_Encryption\Helper::getPublicShareKeyId(); + $this->recovery_key_id = \OCA\Files_Encryption\Helper::getRecoveryKeyId(); + if (\OC_DB::tableExists('encryption_test')) { + \OC_DB::dropTable('encryption_test'); } $this->assertTableNotExist('encryption_test'); } @@ -101,7 +101,7 @@ class Test_Migration extends \OCA\Files_Encryption\Tests\TestCase { // create test table $this->checkLastIndexId(); - OC_DB::createDbFromStructure(__DIR__ . '/encryption_table.xml'); + \OC_DB::createDbFromStructure(__DIR__ . '/encryption_table.xml'); $this->checkLastIndexId(); } @@ -109,12 +109,12 @@ class Test_Migration extends \OCA\Files_Encryption\Tests\TestCase { * @param string $table */ public function assertTableNotExist($table) { - $type=OC_Config::getValue( "dbtype", "sqlite" ); + $type = \OC_Config::getValue( "dbtype", "sqlite" ); if( $type == 'sqlite' || $type == 'sqlite3' ) { // sqlite removes the tables after closing the DB $this->assertTrue(true); } else { - $this->assertFalse(OC_DB::tableExists($table), 'Table ' . $table . ' exists.'); + $this->assertFalse(\OC_DB::tableExists($table), 'Table ' . $table . ' exists.'); } } |