| @@ 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 | { |
|
| @@ 501-509 (lines=9) @@ | ||
| 498 | self::assertEquals($this->getAlterTableColumnCommentsSQL(), $this->_platform->getAlterTableSQL($tableDiff)); |
|
| 499 | } |
|
| 500 | ||
| 501 | public function testCreateTableColumnTypeComments() |
|
| 502 | { |
|
| 503 | $table = new Table('test'); |
|
| 504 | $table->addColumn('id', 'integer'); |
|
| 505 | $table->addColumn('data', 'array'); |
|
| 506 | $table->setPrimaryKey(array('id')); |
|
| 507 | ||
| 508 | self::assertEquals($this->getCreateTableColumnTypeCommentsSQL(), $this->_platform->getCreateTableSQL($table)); |
|
| 509 | } |
|
| 510 | ||
| 511 | public function getCreateTableColumnCommentsSQL() |
|
| 512 | { |
|
| @@ 604-612 (lines=9) @@ | ||
| 601 | /** |
|
| 602 | * @group DBAL-374 |
|
| 603 | */ |
|
| 604 | public function testQuotedColumnInPrimaryKeyPropagation() |
|
| 605 | { |
|
| 606 | $table = new Table('`quoted`'); |
|
| 607 | $table->addColumn('create', 'string'); |
|
| 608 | $table->setPrimaryKey(array('create')); |
|
| 609 | ||
| 610 | $sql = $this->_platform->getCreateTableSQL($table); |
|
| 611 | self::assertEquals($this->getQuotedColumnInPrimaryKeySQL(), $sql); |
|
| 612 | } |
|
| 613 | ||
| 614 | abstract protected function getQuotedColumnInPrimaryKeySQL(); |
|
| 615 | abstract protected function getQuotedColumnInIndexSQL(); |
|
| @@ 622-630 (lines=9) @@ | ||
| 619 | /** |
|
| 620 | * @group DBAL-374 |
|
| 621 | */ |
|
| 622 | public function testQuotedColumnInIndexPropagation() |
|
| 623 | { |
|
| 624 | $table = new Table('`quoted`'); |
|
| 625 | $table->addColumn('create', 'string'); |
|
| 626 | $table->addIndex(array('create')); |
|
| 627 | ||
| 628 | $sql = $this->_platform->getCreateTableSQL($table); |
|
| 629 | self::assertEquals($this->getQuotedColumnInIndexSQL(), $sql); |
|
| 630 | } |
|
| 631 | ||
| 632 | public function testQuotedNameInIndexSQL() |
|
| 633 | { |
|
| @@ 632-640 (lines=9) @@ | ||
| 629 | self::assertEquals($this->getQuotedColumnInIndexSQL(), $sql); |
|
| 630 | } |
|
| 631 | ||
| 632 | public function testQuotedNameInIndexSQL() |
|
| 633 | { |
|
| 634 | $table = new Table('test'); |
|
| 635 | $table->addColumn('column1', 'string'); |
|
| 636 | $table->addIndex(array('column1'), '`key`'); |
|
| 637 | ||
| 638 | $sql = $this->_platform->getCreateTableSQL($table); |
|
| 639 | self::assertEquals($this->getQuotedNameInIndexSQL(), $sql); |
|
| 640 | } |
|
| 641 | ||
| 642 | /** |
|
| 643 | * @group DBAL-374 |
|