Added test for reserved keywords

This commit is contained in:
Vincent Petry 2014-07-01 12:55:36 +02:00
parent b752aff51d
commit e4f068961e
1 changed files with 22 additions and 0 deletions

View File

@ -138,4 +138,26 @@ class Migrator extends \PHPUnit_Framework_TestCase {
$this->assertTrue(true); $this->assertTrue(true);
} }
public function testReservedKeywords() {
$startSchema = new Schema(array(), array(), $this->getSchemaConfig());
$table = $startSchema->createTable($this->tableName);
$table->addColumn('id', 'integer', array('autoincrement' => true));
$table->addColumn('user', 'string', array('length' => 255));
$table->setPrimaryKey(array('id'));
$endSchema = new Schema(array(), array(), $this->getSchemaConfig());
$table = $endSchema->createTable($this->tableName);
$table->addColumn('id', 'integer', array('autoincrement' => true));
$table->addColumn('user', 'string', array('length' => 64));
$table->setPrimaryKey(array('id'));
$migrator = $this->manager->getMigrator();
$migrator->migrate($startSchema);
$migrator->checkMigrate($endSchema);
$migrator->migrate($endSchema);
$this->assertTrue(true);
}
} }