@@ 500-508 (lines=9) @@ | ||
497 | self::assertEquals($this->getAlterTableColumnCommentsSQL(), $this->_platform->getAlterTableSQL($tableDiff)); |
|
498 | } |
|
499 | ||
500 | public function testCreateTableColumnTypeComments() |
|
501 | { |
|
502 | $table = new Table('test'); |
|
503 | $table->addColumn('id', 'integer'); |
|
504 | $table->addColumn('data', 'array'); |
|
505 | $table->setPrimaryKey(array('id')); |
|
506 | ||
507 | self::assertEquals($this->getCreateTableColumnTypeCommentsSQL(), $this->_platform->getCreateTableSQL($table)); |
|
508 | } |
|
509 | ||
510 | public function getCreateTableColumnCommentsSQL() |
|
511 | { |
|
@@ 603-611 (lines=9) @@ | ||
600 | /** |
|
601 | * @group DBAL-374 |
|
602 | */ |
|
603 | public function testQuotedColumnInPrimaryKeyPropagation() |
|
604 | { |
|
605 | $table = new Table('`quoted`'); |
|
606 | $table->addColumn('create', 'string'); |
|
607 | $table->setPrimaryKey(array('create')); |
|
608 | ||
609 | $sql = $this->_platform->getCreateTableSQL($table); |
|
610 | self::assertEquals($this->getQuotedColumnInPrimaryKeySQL(), $sql); |
|
611 | } |
|
612 | ||
613 | abstract protected function getQuotedColumnInPrimaryKeySQL(); |
|
614 | abstract protected function getQuotedColumnInIndexSQL(); |
|
@@ 621-629 (lines=9) @@ | ||
618 | /** |
|
619 | * @group DBAL-374 |
|
620 | */ |
|
621 | public function testQuotedColumnInIndexPropagation() |
|
622 | { |
|
623 | $table = new Table('`quoted`'); |
|
624 | $table->addColumn('create', 'string'); |
|
625 | $table->addIndex(array('create')); |
|
626 | ||
627 | $sql = $this->_platform->getCreateTableSQL($table); |
|
628 | self::assertEquals($this->getQuotedColumnInIndexSQL(), $sql); |
|
629 | } |
|
630 | ||
631 | public function testQuotedNameInIndexSQL() |
|
632 | { |
|
@@ 631-639 (lines=9) @@ | ||
628 | self::assertEquals($this->getQuotedColumnInIndexSQL(), $sql); |
|
629 | } |
|
630 | ||
631 | public function testQuotedNameInIndexSQL() |
|
632 | { |
|
633 | $table = new Table('test'); |
|
634 | $table->addColumn('column1', 'string'); |
|
635 | $table->addIndex(array('column1'), '`key`'); |
|
636 | ||
637 | $sql = $this->_platform->getCreateTableSQL($table); |
|
638 | self::assertEquals($this->getQuotedNameInIndexSQL(), $sql); |
|
639 | } |
|
640 | ||
641 | /** |
|
642 | * @group DBAL-374 |
@@ 138-145 (lines=8) @@ | ||
135 | self::assertEquals('DROP TABLE foobar', $this->_platform->getDropTableSQL('foobar')); |
|
136 | } |
|
137 | ||
138 | public function testGenerateTableWithAutoincrement() |
|
139 | { |
|
140 | $table = new \Doctrine\DBAL\Schema\Table('autoinc_table'); |
|
141 | $column = $table->addColumn('id', 'integer'); |
|
142 | $column->setAutoincrement(true); |
|
143 | ||
144 | self::assertEquals(array('CREATE TABLE autoinc_table (id SERIAL NOT NULL)'), $this->_platform->getCreateTableSQL($table)); |
|
145 | } |
|
146 | ||
147 | public static function serialTypes() : array |
|
148 | { |