diff options
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.'); } } |