Adding test which breaks because bit and/or enum datatypes are used
This commit is contained in:
parent
e2327f83ed
commit
65c824a2c0
1 changed files with 39 additions and 0 deletions
39
tests/lib/db/migration.php
Normal file
39
tests/lib/db/migration.php
Normal file
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue