aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-07-24 12:10:05 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-07-24 12:10:05 +0200
commit65c824a2c019acdb5a6a75648417a8d74e168fef (patch)
tree550208c52a9de70a0444dd5b2e7010a370a64950 /tests
parente2327f83ed60ca29fd1513a40bcefd26e52c54bf (diff)
downloadnextcloud-server-65c824a2c019acdb5a6a75648417a8d74e168fef.tar.gz
nextcloud-server-65c824a2c019acdb5a6a75648417a8d74e168fef.zip
Adding test which breaks because bit and/or enum datatypes are used
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/db/migration.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/lib/db/migration.php b/tests/lib/db/migration.php
new file mode 100644
index 00000000000..820a1431f54
--- /dev/null
+++ b/tests/lib/db/migration.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 TestMigration 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\MySqlPlatform) {
+ $this->markTestSkipped("Test only relevant on MySql");
+ }
+
+ $dbPrefix = \OC::$server->getConfig()->getSystemValue("dbtableprefix");
+ $this->tableName = uniqid($dbPrefix . "_enum_bit_test");
+ $this->connection->exec("CREATE TABLE $this->tableName(b BIT, e ENUM('1','2','3','4'))");
+ }
+
+ 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);
+ }
+
+}