| @@ 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 | { |
|
| @@ 594-602 (lines=9) @@ | ||
| 591 | /** |
|
| 592 | * @group DBAL-374 |
|
| 593 | */ |
|
| 594 | public function testQuotedColumnInPrimaryKeyPropagation() |
|
| 595 | { |
|
| 596 | $table = new Table('`quoted`'); |
|
| 597 | $table->addColumn('create', 'string'); |
|
| 598 | $table->setPrimaryKey(array('create')); |
|
| 599 | ||
| 600 | $sql = $this->_platform->getCreateTableSQL($table); |
|
| 601 | self::assertEquals($this->getQuotedColumnInPrimaryKeySQL(), $sql); |
|
| 602 | } |
|
| 603 | ||
| 604 | abstract protected function getQuotedColumnInPrimaryKeySQL(); |
|
| 605 | abstract protected function getQuotedColumnInIndexSQL(); |
|
| @@ 612-620 (lines=9) @@ | ||
| 609 | /** |
|
| 610 | * @group DBAL-374 |
|
| 611 | */ |
|
| 612 | public function testQuotedColumnInIndexPropagation() |
|
| 613 | { |
|
| 614 | $table = new Table('`quoted`'); |
|
| 615 | $table->addColumn('create', 'string'); |
|
| 616 | $table->addIndex(array('create')); |
|
| 617 | ||
| 618 | $sql = $this->_platform->getCreateTableSQL($table); |
|
| 619 | self::assertEquals($this->getQuotedColumnInIndexSQL(), $sql); |
|
| 620 | } |
|
| 621 | ||
| 622 | public function testQuotedNameInIndexSQL() |
|
| 623 | { |
|
| @@ 622-630 (lines=9) @@ | ||
| 619 | self::assertEquals($this->getQuotedColumnInIndexSQL(), $sql); |
|
| 620 | } |
|
| 621 | ||
| 622 | public function testQuotedNameInIndexSQL() |
|
| 623 | { |
|
| 624 | $table = new Table('test'); |
|
| 625 | $table->addColumn('column1', 'string'); |
|
| 626 | $table->addIndex(array('column1'), '`key`'); |
|
| 627 | ||
| 628 | $sql = $this->_platform->getCreateTableSQL($table); |
|
| 629 | self::assertEquals($this->getQuotedNameInIndexSQL(), $sql); |
|
| 630 | } |
|
| 631 | ||
| 632 | /** |
|
| 633 | * @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 function testGeneratesTypeDeclarationForIntegers() |
|
| 148 | { |
|