aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-07-30 11:48:10 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-07-30 11:48:10 +0200
commit54d5d0327134c958c1610528d737aadef4f418ff (patch)
tree1edfcdaeee5420fe64b6c0dc5e6fefb3588f47ec /tests
parent7d6221d25dd02066eadb07325fdef0581bf31771 (diff)
parent58472a2660734ceff22aa72f704938c3179d7cd1 (diff)
downloadnextcloud-server-54d5d0327134c958c1610528d737aadef4f418ff.tar.gz
nextcloud-server-54d5d0327134c958c1610528d737aadef4f418ff.zip
Merge pull request #9888 from owncloud/mysql-tinyint-master
migration test for sqlite - adding type mapping for 'tinyint unsigned'
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/db/mysqlmigration.php (renamed from tests/lib/db/migration.php)2
-rw-r--r--tests/lib/db/sqlitemigration.php39
2 files changed, 40 insertions, 1 deletions
diff --git a/tests/lib/db/migration.php b/tests/lib/db/mysqlmigration.php
index 820a1431f54..584df1d4465 100644
--- a/tests/lib/db/migration.php
+++ b/tests/lib/db/mysqlmigration.php
@@ -6,7 +6,7 @@
* See the COPYING-README file.
*/
-class TestMigration extends \PHPUnit_Framework_TestCase {
+class TestMySqlMigration extends \PHPUnit_Framework_TestCase {
/** @var \Doctrine\DBAL\Connection */
private $connection;
diff --git a/tests/lib/db/sqlitemigration.php b/tests/lib/db/sqlitemigration.php
new file mode 100644
index 00000000000..adfc03a2ca7
--- /dev/null
+++ b/tests/lib/db/sqlitemigration.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Copyright (c) 2014 Thomas Müller <deepdiver@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+class TestSqliteMigration extends \PHPUnit_Framework_TestCase {
+
+ /** @var \Doctrine\DBAL\Connection */
+ private $connection;
+
+ /** @var string */
+ private $tableName;
+
+ public function setUp() {
+ $this->connection = \OC_DB::getConnection();
+ if (!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\SqlitePlatform) {
+ $this->markTestSkipped("Test only relevant on Sqlite");
+ }
+
+ $dbPrefix = \OC::$server->getConfig()->getSystemValue("dbtableprefix");
+ $this->tableName = uniqid($dbPrefix . "_enum_bit_test");
+ $this->connection->exec("CREATE TABLE $this->tableName(t0 tinyint unsigned, t1 tinyint)");
+ }
+
+ public function tearDown() {
+ $this->connection->getSchemaManager()->dropTable($this->tableName);
+ }
+
+ public function testNonOCTables() {
+ $manager = new \OC\DB\MDB2SchemaManager($this->connection);
+ $manager->updateDbFromStructure(__DIR__ . '/testschema.xml');
+
+ $this->assertTrue(true);
+ }
+
+}