From 93bacd3af00018d0c0e991bd93c9584e574c43ca Mon Sep 17 00:00:00 2001 From: "Fabio B. Silva" Date: Wed, 6 Jun 2012 11:30:10 -0300 Subject: [PATCH] test quoted primary key --- .../DBAL/Platforms/SqlitePlatformTest.php | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/Doctrine/Tests/DBAL/Platforms/SqlitePlatformTest.php b/tests/Doctrine/Tests/DBAL/Platforms/SqlitePlatformTest.php index 3db4d011e0e..6548cf8a62b 100644 --- a/tests/Doctrine/Tests/DBAL/Platforms/SqlitePlatformTest.php +++ b/tests/Doctrine/Tests/DBAL/Platforms/SqlitePlatformTest.php @@ -131,4 +131,25 @@ public function testGetAlterTableSqlDispatchEvent() { $this->markTestSkipped('SQlite does not support ALTER Table.'); } + + /** + * @group DDC-1845 + */ + public function testGenerateTableSqlShouldNotAutoQuotePrimaryKey() + { + $table = new \Doctrine\DBAL\Schema\Table('test'); + $table->addColumn('"like"', 'integer', array('notnull' => true, 'autoincrement' => true)); + $table->setPrimaryKey(array('"like"')); + + $createTableSQL = $this->_platform->getCreateTableSQL($table); + $this->assertEquals( + 'CREATE TABLE test ("like" INTEGER NOT NULL, PRIMARY KEY("like"))', + $createTableSQL[0] + ); + + $this->assertEquals( + 'ALTER TABLE test ADD PRIMARY KEY ("like")', + $this->_platform->getCreatePrimaryKeySQL($table->getIndex('primary'), 'test') + ); + } } \ No newline at end of file