2014-07-24 14:10:05 +04:00
|
|
|
<?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.
|
|
|
|
*/
|
|
|
|
|
2014-07-25 10:46:43 +04:00
|
|
|
class TestSqliteMigration extends \PHPUnit_Framework_TestCase {
|
2014-07-24 14:10:05 +04:00
|
|
|
|
|
|
|
/** @var \Doctrine\DBAL\Connection */
|
|
|
|
private $connection;
|
|
|
|
|
|
|
|
/** @var string */
|
|
|
|
private $tableName;
|
|
|
|
|
|
|
|
public function setUp() {
|
|
|
|
$this->connection = \OC_DB::getConnection();
|
2014-07-25 10:46:43 +04:00
|
|
|
if (!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\SqlitePlatform) {
|
|
|
|
$this->markTestSkipped("Test only relevant on Sqlite");
|
2014-07-24 14:10:05 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
$dbPrefix = \OC::$server->getConfig()->getSystemValue("dbtableprefix");
|
|
|
|
$this->tableName = uniqid($dbPrefix . "_enum_bit_test");
|
2014-07-25 10:46:43 +04:00
|
|
|
$this->connection->exec("CREATE TABLE $this->tableName(t0 tinyint unsigned, t1 tinyint)");
|
2014-07-24 14:10:05 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|