aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-03-14 14:38:34 +0100
committerRobin Appelman <icewind@owncloud.com>2014-06-03 11:17:21 +0200
commit5243562f45716920b1015a431365dc3fc0bbaf45 (patch)
tree5efac1219cd7a699116217758730ce36289500fa /tests
parentbe80dce58564c88aa74fb353ab17793fc7eb37e0 (diff)
downloadnextcloud-server-5243562f45716920b1015a431365dc3fc0bbaf45.tar.gz
nextcloud-server-5243562f45716920b1015a431365dc3fc0bbaf45.zip
skip migration tests for sqlite
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/db/migrator.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/lib/db/migrator.php b/tests/lib/db/migrator.php
index e08f1cf4547..258d6451847 100644
--- a/tests/lib/db/migrator.php
+++ b/tests/lib/db/migrator.php
@@ -25,7 +25,11 @@ class Migrator extends \PHPUnit_Framework_TestCase {
public function setUp() {
$this->tableName = 'test_' . uniqid();
$this->connection = \OC_DB::getConnection();
- $this->fullTableName = $this->connection->getDatabase() . '.' . $this->tableName;
+ if ($this->connection->getDriver() instanceof \Doctrine\DBAL\Driver\PDOSqlite\Driver) {
+ $this->markTestSkipped('Migration tests dont function on sqlite since sqlite doesnt give an error on existing duplicate data');
+ } else {
+ $this->fullTableName = $this->connection->getDatabase() . '.' . $this->tableName;
+ }
}
public function tearDown() {
@@ -56,11 +60,15 @@ class Migrator extends \PHPUnit_Framework_TestCase {
return $config;
}
+ private function getMigrator() {
+ return new \OC\DB\Migrator($this->connection);
+ }
+
/**
* @expectedException \OC\DB\MigrationException
*/
public function testDuplicateKeyUpgrade() {
- $migrator = new \OC\DB\Migrator($this->connection);
+ $migrator = $this->getMigrator();
$migrator->migrate($this->getInitialSchema());
$this->connection->insert($this->tableName, array('id' => 1, 'name' => 'foo'));
@@ -72,7 +80,7 @@ class Migrator extends \PHPUnit_Framework_TestCase {
}
public function testUpgrade() {
- $migrator = new \OC\DB\Migrator($this->connection);
+ $migrator = $this->getMigrator();
$migrator->migrate($this->getInitialSchema());
$this->connection->insert($this->tableName, array('id' => 1, 'name' => 'foo'));