diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-10-23 14:32:37 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-10-23 14:35:44 +0200 |
commit | 5aab98c4bf1904f9886c4fe091546f9edab1fb4d (patch) | |
tree | 4052c0456a5bdc195e9287b440cd0f9d9975ba3a /tests/lib/db | |
parent | 770f643e5cf78493dde576f85fee9c4b66a31f38 (diff) | |
download | nextcloud-server-5aab98c4bf1904f9886c4fe091546f9edab1fb4d.tar.gz nextcloud-server-5aab98c4bf1904f9886c4fe091546f9edab1fb4d.zip |
disable database migration unit tests for MSSQL
Diffstat (limited to 'tests/lib/db')
-rw-r--r-- | tests/lib/db/mdb2schemamanager.php | 10 | ||||
-rw-r--r-- | tests/lib/db/migrator.php | 11 |
2 files changed, 16 insertions, 5 deletions
diff --git a/tests/lib/db/mdb2schemamanager.php b/tests/lib/db/mdb2schemamanager.php index dd9ee3adb8e..527b2cba648 100644 --- a/tests/lib/db/mdb2schemamanager.php +++ b/tests/lib/db/mdb2schemamanager.php @@ -9,6 +9,9 @@ namespace Test\DB; +use Doctrine\DBAL\Platforms\OraclePlatform; +use Doctrine\DBAL\Platforms\SQLServerPlatform; + class MDB2SchemaManager extends \PHPUnit_Framework_TestCase { public function tearDown() { @@ -22,11 +25,14 @@ class MDB2SchemaManager extends \PHPUnit_Framework_TestCase { public function testAutoIncrement() { - if (\OC::$server->getConfig()->getSystemValue('dbtype', 'sqlite') === 'oci') { + $connection = \OC_DB::getConnection(); + if ($connection->getDatabasePlatform() instanceof OraclePlatform) { $this->markTestSkipped('Adding auto increment columns in Oracle is not supported.'); } + if ($connection->getDatabasePlatform() instanceof SQLServerPlatform) { + $this->markTestSkipped('DB migration tests are not supported on MSSQL'); + } - $connection = \OC_DB::getConnection(); $manager = new \OC\DB\MDB2SchemaManager($connection); $manager->createDbFromStructure(__DIR__ . '/ts-autoincrement-before.xml'); diff --git a/tests/lib/db/migrator.php b/tests/lib/db/migrator.php index 2e49086bd63..09742a53eb4 100644 --- a/tests/lib/db/migrator.php +++ b/tests/lib/db/migrator.php @@ -10,6 +10,8 @@ namespace Test\DB; use \Doctrine\DBAL\DBALException; +use Doctrine\DBAL\Platforms\OraclePlatform; +use Doctrine\DBAL\Platforms\SQLServerPlatform; use \Doctrine\DBAL\Schema\Schema; use \Doctrine\DBAL\Schema\SchemaConfig; @@ -28,8 +30,11 @@ class Migrator extends \PHPUnit_Framework_TestCase { public function setUp() { $this->connection = \OC_DB::getConnection(); - if ($this->connection->getDriver() instanceof \Doctrine\DBAL\Driver\OCI8\Driver) { - $this->markTestSkipped('DB migration tests arent supported on OCI'); + if ($this->connection->getDatabasePlatform() instanceof OraclePlatform) { + $this->markTestSkipped('DB migration tests are not supported on OCI'); + } + if ($this->connection->getDatabasePlatform() instanceof SQLServerPlatform) { + $this->markTestSkipped('DB migration tests are not supported on MSSQL'); } $this->manager = new \OC\DB\MDB2SchemaManager($this->connection); $this->tableName = 'test_' . uniqid(); @@ -73,7 +78,7 @@ class Migrator extends \PHPUnit_Framework_TestCase { */ public function testDuplicateKeyUpgrade() { if ($this->isSQLite()) { - $this->markTestSkipped('sqlite doesnt throw errors when creating a new key on existing data'); + $this->markTestSkipped('sqlite does not throw errors when creating a new key on existing data'); } list($startSchema, $endSchema) = $this->getDuplicateKeySchemas(); $migrator = $this->manager->getMigrator(); |