summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-01-07 10:26:00 +0100
committerMorris Jobke <hey@morrisjobke.de>2016-01-07 14:54:55 +0100
commit190cc2bb6762c5f505e1e90bd582caa4fecb9cce (patch)
treee758dbc6da9f106d07146838507988b6a7d9bda1 /tests
parentfddece9552a4b194cdce8c3916e33fa8597c9008 (diff)
downloadnextcloud-server-190cc2bb6762c5f505e1e90bd582caa4fecb9cce.tar.gz
nextcloud-server-190cc2bb6762c5f505e1e90bd582caa4fecb9cce.zip
Remove OC_DB::getConnection
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/app.php6
-rw-r--r--tests/lib/db/mdb2schemamanager.php2
-rw-r--r--tests/lib/db/migrator.php2
-rw-r--r--tests/lib/db/mysqlmigration.php2
-rw-r--r--tests/lib/db/sqlitemigration.php2
-rw-r--r--tests/lib/dbschema.php4
-rw-r--r--tests/lib/repair/repaircollation.php2
-rw-r--r--tests/lib/repair/repairinnodb.php2
-rw-r--r--tests/lib/repair/repairsqliteautoincrement.php2
-rw-r--r--tests/lib/tags.php4
10 files changed, 14 insertions, 14 deletions
diff --git a/tests/lib/app.php b/tests/lib/app.php
index 1c38a1c161f..389c9e5d2cf 100644
--- a/tests/lib/app.php
+++ b/tests/lib/app.php
@@ -461,7 +461,7 @@ class Test_App extends \Test\TestCase {
$appConfig = $this->getMock(
'\OC\AppConfig',
array('getValues'),
- array(\OC_DB::getConnection()),
+ array(\OC::$server->getDatabaseConnection()),
'',
false
);
@@ -488,8 +488,8 @@ class Test_App extends \Test\TestCase {
* Restore the original app config service.
*/
private function restoreAppConfig() {
- \OC::$server->registerService('AppConfig', function ($c) {
- return new \OC\AppConfig(\OC_DB::getConnection());
+ \OC::$server->registerService('AppConfig', function (\OC\Server $c) {
+ return new \OC\AppConfig($c->getDatabaseConnection());
});
\OC::$server->registerService('AppManager', function (\OC\Server $c) {
return new \OC\App\AppManager($c->getUserSession(), $c->getAppConfig(), $c->getGroupManager(), $c->getMemCacheFactory());
diff --git a/tests/lib/db/mdb2schemamanager.php b/tests/lib/db/mdb2schemamanager.php
index 470e385b858..fd412bdec2d 100644
--- a/tests/lib/db/mdb2schemamanager.php
+++ b/tests/lib/db/mdb2schemamanager.php
@@ -32,7 +32,7 @@ class MDB2SchemaManager extends \Test\TestCase {
public function testAutoIncrement() {
- $connection = \OC_DB::getConnection();
+ $connection = \OC::$server->getDatabaseConnection();
if ($connection->getDatabasePlatform() instanceof OraclePlatform) {
$this->markTestSkipped('Adding auto increment columns in Oracle is not supported.');
}
diff --git a/tests/lib/db/migrator.php b/tests/lib/db/migrator.php
index a50c5f1b864..84a98c1e338 100644
--- a/tests/lib/db/migrator.php
+++ b/tests/lib/db/migrator.php
@@ -45,7 +45,7 @@ class Migrator extends \Test\TestCase {
parent::setUp();
$this->config = \OC::$server->getConfig();
- $this->connection = \OC_DB::getConnection();
+ $this->connection = \OC::$server->getDatabaseConnection();
if ($this->connection->getDatabasePlatform() instanceof OraclePlatform) {
$this->markTestSkipped('DB migration tests are not supported on OCI');
}
diff --git a/tests/lib/db/mysqlmigration.php b/tests/lib/db/mysqlmigration.php
index 50b9d91d4ee..51e8801dc3b 100644
--- a/tests/lib/db/mysqlmigration.php
+++ b/tests/lib/db/mysqlmigration.php
@@ -22,7 +22,7 @@ class TestMySqlMigration extends \Test\TestCase {
protected function setUp() {
parent::setUp();
- $this->connection = \OC_DB::getConnection();
+ $this->connection = \OC::$server->getDatabaseConnection();
if (!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySqlPlatform) {
$this->markTestSkipped("Test only relevant on MySql");
}
diff --git a/tests/lib/db/sqlitemigration.php b/tests/lib/db/sqlitemigration.php
index 3674d452bae..f23f4d4ee86 100644
--- a/tests/lib/db/sqlitemigration.php
+++ b/tests/lib/db/sqlitemigration.php
@@ -22,7 +22,7 @@ class TestSqliteMigration extends \Test\TestCase {
protected function setUp() {
parent::setUp();
- $this->connection = \OC_DB::getConnection();
+ $this->connection = \OC::$server->getDatabaseConnection();
if (!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\SqlitePlatform) {
$this->markTestSkipped("Test only relevant on Sqlite");
}
diff --git a/tests/lib/dbschema.php b/tests/lib/dbschema.php
index 46d7559acc2..d96f8195770 100644
--- a/tests/lib/dbschema.php
+++ b/tests/lib/dbschema.php
@@ -51,7 +51,7 @@ class Test_DBSchema extends \Test\TestCase {
* @medium
*/
public function testSchema() {
- $platform = \OC_DB::getConnection()->getDatabasePlatform();
+ $platform = \OC::$server->getDatabaseConnection()->getDatabasePlatform();
$this->doTestSchemaCreating();
$this->doTestSchemaChanging();
$this->doTestSchemaDumping();
@@ -94,7 +94,7 @@ class Test_DBSchema extends \Test\TestCase {
* @param string $table
*/
public function assertTableNotExist($table) {
- $platform = \OC_DB::getConnection()->getDatabasePlatform();
+ $platform = \OC::$server->getDatabaseConnection()->getDatabasePlatform();
if ($platform instanceof \Doctrine\DBAL\Platforms\SqlitePlatform) {
// sqlite removes the tables after closing the DB
$this->assertTrue(true);
diff --git a/tests/lib/repair/repaircollation.php b/tests/lib/repair/repaircollation.php
index f9d921e88a4..8d609aeed38 100644
--- a/tests/lib/repair/repaircollation.php
+++ b/tests/lib/repair/repaircollation.php
@@ -48,7 +48,7 @@ class TestRepairCollation extends \Test\TestCase {
protected function setUp() {
parent::setUp();
- $this->connection = \OC_DB::getConnection();
+ $this->connection = \OC::$server->getDatabaseConnection();
$this->config = \OC::$server->getConfig();
if (!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySqlPlatform) {
$this->markTestSkipped("Test only relevant on MySql");
diff --git a/tests/lib/repair/repairinnodb.php b/tests/lib/repair/repairinnodb.php
index e7d2b83c224..5c73b931367 100644
--- a/tests/lib/repair/repairinnodb.php
+++ b/tests/lib/repair/repairinnodb.php
@@ -28,7 +28,7 @@ class RepairInnoDB extends \Test\TestCase {
protected function setUp() {
parent::setUp();
- $this->connection = \OC_DB::getConnection();
+ $this->connection = \OC::$server->getDatabaseConnection();
if (!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySqlPlatform) {
$this->markTestSkipped("Test only relevant on MySql");
}
diff --git a/tests/lib/repair/repairsqliteautoincrement.php b/tests/lib/repair/repairsqliteautoincrement.php
index e3bb110191b..6f0c2cb8d28 100644
--- a/tests/lib/repair/repairsqliteautoincrement.php
+++ b/tests/lib/repair/repairsqliteautoincrement.php
@@ -38,7 +38,7 @@ class RepairSqliteAutoincrement extends \Test\TestCase {
protected function setUp() {
parent::setUp();
- $this->connection = \OC_DB::getConnection();
+ $this->connection = \OC::$server->getDatabaseConnection();
$this->config = \OC::$server->getConfig();
if (!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\SqlitePlatform) {
$this->markTestSkipped("Test only relevant on Sqlite");
diff --git a/tests/lib/tags.php b/tests/lib/tags.php
index 537c898da13..91472d5ceb8 100644
--- a/tests/lib/tags.php
+++ b/tests/lib/tags.php
@@ -60,7 +60,7 @@ class Test_Tags extends \Test\TestCase {
}
protected function tearDown() {
- $conn = \OC_DB::getConnection();
+ $conn = \OC::$server->getDatabaseConnection();
$conn->executeQuery('DELETE FROM `*PREFIX*vcategory_to_object`');
$conn->executeQuery('DELETE FROM `*PREFIX*vcategory`');
@@ -199,7 +199,7 @@ class Test_Tags extends \Test\TestCase {
$tagId = $tagData[0]['id'];
$tagType = $tagData[0]['type'];
- $conn = \OC_DB::getConnection();
+ $conn = \OC::$server->getDatabaseConnection();
$statement = $conn->prepare(
'INSERT INTO `*PREFIX*vcategory_to_object` ' .
'(`objid`, `categoryid`, `type`) VALUES ' .