summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-07-01 12:55:36 +0200
committerVincent Petry <pvince81@owncloud.com>2014-07-01 12:55:36 +0200
commite4f068961e828f6d09c7174f7a1a9ff83b62689e (patch)
tree0816fdaff4820abf3cc300339df62f09d827027f /tests
parentb752aff51d4bfea37a52bd832c3d645996e6dd8d (diff)
downloadnextcloud-server-e4f068961e828f6d09c7174f7a1a9ff83b62689e.tar.gz
nextcloud-server-e4f068961e828f6d09c7174f7a1a9ff83b62689e.zip
Added test for reserved keywords
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/db/migrator.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/lib/db/migrator.php b/tests/lib/db/migrator.php
index aa9c96841ff..2e49086bd63 100644
--- a/tests/lib/db/migrator.php
+++ b/tests/lib/db/migrator.php
@@ -138,4 +138,26 @@ class Migrator extends \PHPUnit_Framework_TestCase {
$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);
+ }
}