Commit 5ca7d3ca authored by Markus Fasselt's avatar Markus Fasselt Committed by Steve Müller

#723 - Added tests

parent 24fb533b
......@@ -442,6 +442,7 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
abstract protected function getQuotedColumnInPrimaryKeySQL();
abstract protected function getQuotedColumnInIndexSQL();
abstract protected function getQuotedNameInIndexSQL();
abstract protected function getQuotedColumnInForeignKeySQL();
/**
......@@ -457,6 +458,16 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
$this->assertEquals($this->getQuotedColumnInIndexSQL(), $sql);
}
public function testQuotedNameInIndexSQL()
{
$table = new Table('test');
$table->addColumn('column1', 'string');
$table->addIndex(array('column1'), 'create');
$sql = $this->_platform->getCreateTableSQL($table);
$this->assertEquals($this->getQuotedNameInIndexSQL(), $sql);
}
/**
* @group DBAL-374
*/
......
......@@ -248,6 +248,13 @@ class MySqlPlatformTest extends AbstractPlatformTestCase
);
}
protected function getQuotedNameInIndexSQL()
{
return array(
'CREATE TABLE test (column1 VARCHAR(255) NOT NULL, INDEX `create` (column1)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
);
}
protected function getQuotedColumnInForeignKeySQL()
{
return array(
......
......@@ -344,6 +344,14 @@ class OraclePlatformTest extends AbstractPlatformTestCase
);
}
protected function getQuotedNameInIndexSQL()
{
return array(
'CREATE TABLE test (column1 VARCHAR2(255) NOT NULL)',
'CREATE INDEX "create" ON test (column1)',
);
}
protected function getQuotedColumnInForeignKeySQL()
{
return array(
......
......@@ -284,6 +284,14 @@ class PostgreSqlPlatformTest extends AbstractPlatformTestCase
);
}
protected function getQuotedNameInIndexSQL()
{
return array(
'CREATE TABLE test (column1 VARCHAR(255) NOT NULL)',
'CREATE INDEX "create" ON test (column1)',
);
}
protected function getQuotedColumnInForeignKeySQL()
{
return array(
......
......@@ -353,4 +353,12 @@ class SQLServerPlatformTest extends AbstractPlatformTestCase
'ALTER TABLE mytable ALTER COLUMN name NCHAR(2) NOT NULL',
);
}
protected function getQuotedNameInIndexSQL()
{
return array(
'CREATE TABLE test (column1 NVARCHAR(255) NOT NULL)',
'CREATE INDEX [create] ON test (column1)',
);
}
}
......@@ -292,6 +292,14 @@ class SqlitePlatformTest extends AbstractPlatformTestCase
);
}
protected function getQuotedNameInIndexSQL()
{
return array(
'CREATE TABLE test (column1 VARCHAR(255) NOT NULL)',
'CREATE INDEX "create" ON test (column1)',
);
}
protected function getQuotedColumnInForeignKeySQL()
{
return array(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment