2014-07-24 10:10:05 +00: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.
|
|
|
|
*/
|
|
|
|
|
2015-11-03 00:52:41 +00:00
|
|
|
/**
|
|
|
|
* Class TestSqliteMigration
|
|
|
|
*
|
|
|
|
* @group DB
|
|
|
|
*/
|
2014-11-10 22:30:38 +00:00
|
|
|
class TestSqliteMigration extends \Test\TestCase {
|
2014-07-24 10:10:05 +00:00
|
|
|
|
|
|
|
/** @var \Doctrine\DBAL\Connection */
|
|
|
|
private $connection;
|
|
|
|
|
|
|
|
/** @var string */
|
|
|
|
private $tableName;
|
|
|
|
|
2014-11-10 22:30:38 +00:00
|
|
|
protected function setUp() {
|
|
|
|
parent::setUp();
|
|
|
|
|
2014-07-24 10:10:05 +00:00
|
|
|
$this->connection = \OC_DB::getConnection();
|
2014-07-25 06:46:43 +00:00
|
|
|
if (!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\SqlitePlatform) {
|
|
|
|
$this->markTestSkipped("Test only relevant on Sqlite");
|
2014-07-24 10:10:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$dbPrefix = \OC::$server->getConfig()->getSystemValue("dbtableprefix");
|
2014-12-02 12:51:36 +00:00
|
|
|
$this->tableName = $this->getUniqueID($dbPrefix . '_enum_bit_test');
|
2014-07-25 06:46:43 +00:00
|
|
|
$this->connection->exec("CREATE TABLE $this->tableName(t0 tinyint unsigned, t1 tinyint)");
|
2014-07-24 10:10:05 +00:00
|
|
|
}
|
|
|
|
|
2014-11-10 22:30:38 +00:00
|
|
|
protected function tearDown() {
|
2014-07-24 10:10:05 +00:00
|
|
|
$this->connection->getSchemaManager()->dropTable($this->tableName);
|
2014-11-10 22:30:38 +00:00
|
|
|
parent::tearDown();
|
2014-07-24 10:10:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testNonOCTables() {
|
|
|
|
$manager = new \OC\DB\MDB2SchemaManager($this->connection);
|
|
|
|
$manager->updateDbFromStructure(__DIR__ . '/testschema.xml');
|
|
|
|
|
|
|
|
$this->assertTrue(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|