diff options
Diffstat (limited to 'tests/lib/DB/MySqlMigrationTest.php')
-rw-r--r-- | tests/lib/DB/MySqlMigrationTest.php | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/lib/DB/MySqlMigrationTest.php b/tests/lib/DB/MySqlMigrationTest.php new file mode 100644 index 00000000000..cdc7ef47784 --- /dev/null +++ b/tests/lib/DB/MySqlMigrationTest.php @@ -0,0 +1,49 @@ +<?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. + */ + +namespace Test\DB; + +/** + * Class MySqlMigration + * + * @group DB + */ +class MySqlMigrationTest extends \Test\TestCase { + + /** @var \Doctrine\DBAL\Connection */ + private $connection; + + /** @var string */ + private $tableName; + + protected function setUp() { + parent::setUp(); + + $this->connection = \OC::$server->getDatabaseConnection(); + if (!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySqlPlatform) { + $this->markTestSkipped("Test only relevant on MySql"); + } + + $dbPrefix = \OC::$server->getConfig()->getSystemValue("dbtableprefix"); + $this->tableName = $this->getUniqueID($dbPrefix . '_enum_bit_test'); + $this->connection->exec("CREATE TABLE $this->tableName(b BIT, e ENUM('1','2','3','4'))"); + } + + protected function tearDown() { + $this->connection->getSchemaManager()->dropTable($this->tableName); + parent::tearDown(); + } + + public function testNonOCTables() { + $manager = new \OC\DB\MDB2SchemaManager($this->connection); + $manager->updateDbFromStructure(__DIR__ . '/testschema.xml'); + + $this->assertTrue(true); + } + +} |