|
@@ 163-172 (lines=10) @@
|
| 160 |
|
$sql = $this->_platform->getCreateTableSQL($table); |
| 161 |
|
} |
| 162 |
|
|
| 163 |
|
public function testGeneratesTableCreationSql() |
| 164 |
|
{ |
| 165 |
|
$table = new Table('test'); |
| 166 |
|
$table->addColumn('id', 'integer', array('notnull' => true, 'autoincrement' => true)); |
| 167 |
|
$table->addColumn('test', 'string', array('notnull' => false, 'length' => 255)); |
| 168 |
|
$table->setPrimaryKey(array('id')); |
| 169 |
|
|
| 170 |
|
$sql = $this->_platform->getCreateTableSQL($table); |
| 171 |
|
self::assertEquals($this->getGenerateTableSql(), $sql[0]); |
| 172 |
|
} |
| 173 |
|
|
| 174 |
|
abstract public function getGenerateTableSql(); |
| 175 |
|
|
|
@@ 176-185 (lines=10) @@
|
| 173 |
|
|
| 174 |
|
abstract public function getGenerateTableSql(); |
| 175 |
|
|
| 176 |
|
public function testGenerateTableWithMultiColumnUniqueIndex() |
| 177 |
|
{ |
| 178 |
|
$table = new Table('test'); |
| 179 |
|
$table->addColumn('foo', 'string', array('notnull' => false, 'length' => 255)); |
| 180 |
|
$table->addColumn('bar', 'string', array('notnull' => false, 'length' => 255)); |
| 181 |
|
$table->addUniqueIndex(array("foo", "bar")); |
| 182 |
|
|
| 183 |
|
$sql = $this->_platform->getCreateTableSQL($table); |
| 184 |
|
self::assertEquals($this->getGenerateTableWithMultiColumnUniqueIndexSql(), $sql); |
| 185 |
|
} |
| 186 |
|
|
| 187 |
|
abstract public function getGenerateTableWithMultiColumnUniqueIndexSql(); |
| 188 |
|
|