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

#723 - Added tests

parent 93e91bcf
...@@ -242,6 +242,13 @@ abstract class AbstractMySQLPlatformTestCase extends AbstractPlatformTestCase ...@@ -242,6 +242,13 @@ abstract class AbstractMySQLPlatformTestCase extends AbstractPlatformTestCase
); );
} }
protected function getQuotedNameInIndexSQL()
{
return array(
'CREATE TABLE test (column1 VARCHAR(255) NOT NULL, INDEX `key` (column1)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
);
}
protected function getQuotedColumnInForeignKeySQL() protected function getQuotedColumnInForeignKeySQL()
{ {
return array( return array(
......
...@@ -539,6 +539,7 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase ...@@ -539,6 +539,7 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
abstract protected function getQuotedColumnInPrimaryKeySQL(); abstract protected function getQuotedColumnInPrimaryKeySQL();
abstract protected function getQuotedColumnInIndexSQL(); abstract protected function getQuotedColumnInIndexSQL();
abstract protected function getQuotedNameInIndexSQL();
abstract protected function getQuotedColumnInForeignKeySQL(); abstract protected function getQuotedColumnInForeignKeySQL();
/** /**
...@@ -554,6 +555,16 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase ...@@ -554,6 +555,16 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
$this->assertEquals($this->getQuotedColumnInIndexSQL(), $sql); $this->assertEquals($this->getQuotedColumnInIndexSQL(), $sql);
} }
public function testQuotedNameInIndexSQL()
{
$table = new Table('test');
$table->addColumn('column1', 'string');
$table->addIndex(array('column1'), '`key`');
$sql = $this->_platform->getCreateTableSQL($table);
$this->assertEquals($this->getQuotedNameInIndexSQL(), $sql);
}
/** /**
* @group DBAL-374 * @group DBAL-374
*/ */
......
...@@ -280,6 +280,14 @@ abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCa ...@@ -280,6 +280,14 @@ abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCa
); );
} }
protected function getQuotedNameInIndexSQL()
{
return array(
'CREATE TABLE test (column1 VARCHAR(255) NOT NULL)',
'CREATE INDEX "key" ON test (column1)',
);
}
protected function getQuotedColumnInForeignKeySQL() protected function getQuotedColumnInForeignKeySQL()
{ {
return array( return array(
......
...@@ -455,6 +455,14 @@ abstract class AbstractSQLServerPlatformTestCase extends AbstractPlatformTestCas ...@@ -455,6 +455,14 @@ abstract class AbstractSQLServerPlatformTestCase extends AbstractPlatformTestCas
); );
} }
protected function getQuotedNameInIndexSQL()
{
return array(
'CREATE TABLE test (column1 NVARCHAR(255) NOT NULL)',
'CREATE INDEX [key] ON test (column1)',
);
}
protected function getQuotedColumnInForeignKeySQL() protected function getQuotedColumnInForeignKeySQL()
{ {
return array( return array(
......
...@@ -86,6 +86,14 @@ class DB2PlatformTest extends AbstractPlatformTestCase ...@@ -86,6 +86,14 @@ class DB2PlatformTest extends AbstractPlatformTestCase
); );
} }
protected function getQuotedNameInIndexSQL()
{
return array(
'CREATE TABLE test (column1 VARCHAR(255) NOT NULL)',
'CREATE INDEX "key" ON test (column1)',
);
}
protected function getQuotedColumnInPrimaryKeySQL() protected function getQuotedColumnInPrimaryKeySQL()
{ {
return array( return array(
......
...@@ -344,6 +344,14 @@ class OraclePlatformTest extends AbstractPlatformTestCase ...@@ -344,6 +344,14 @@ class OraclePlatformTest extends AbstractPlatformTestCase
); );
} }
protected function getQuotedNameInIndexSQL()
{
return array(
'CREATE TABLE test (column1 VARCHAR2(255) NOT NULL)',
'CREATE INDEX "key" ON test (column1)',
);
}
protected function getQuotedColumnInForeignKeySQL() protected function getQuotedColumnInForeignKeySQL()
{ {
return array( return array(
......
...@@ -78,6 +78,14 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase ...@@ -78,6 +78,14 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
); );
} }
protected function getQuotedNameInIndexSQL()
{
return array(
'CREATE TABLE test (column1 VARCHAR(255) NOT NULL)',
'CREATE INDEX "key" ON test (column1)',
);
}
protected function getQuotedColumnInPrimaryKeySQL() protected function getQuotedColumnInPrimaryKeySQL()
{ {
return array( return array(
......
...@@ -440,6 +440,14 @@ class SqlitePlatformTest extends AbstractPlatformTestCase ...@@ -440,6 +440,14 @@ class SqlitePlatformTest extends AbstractPlatformTestCase
); );
} }
protected function getQuotedNameInIndexSQL()
{
return array(
'CREATE TABLE test (column1 VARCHAR(255) NOT NULL)',
'CREATE INDEX "key" ON test (column1)',
);
}
protected function getQuotedColumnInForeignKeySQL() protected function getQuotedColumnInForeignKeySQL()
{ {
return array( 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