Skip to content

Commit

Permalink
test quoted primary key
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioBatSilva committed Jun 6, 2012
1 parent 439d12c commit 93bacd3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/Doctrine/Tests/DBAL/Platforms/SqlitePlatformTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
);
}
}

0 comments on commit 93bacd3

Please sign in to comment.