| @@ 514-522 (lines=9) @@ | ||
| 511 | self::assertEquals($this->getAlterTableColumnCommentsSQL(), $this->_platform->getAlterTableSQL($tableDiff)); |
|
| 512 | } |
|
| 513 | ||
| 514 | public function testCreateTableColumnTypeComments() |
|
| 515 | { |
|
| 516 | $table = new Table('test'); |
|
| 517 | $table->addColumn('id', 'integer'); |
|
| 518 | $table->addColumn('data', 'array'); |
|
| 519 | $table->setPrimaryKey(array('id')); |
|
| 520 | ||
| 521 | self::assertEquals($this->getCreateTableColumnTypeCommentsSQL(), $this->_platform->getCreateTableSQL($table)); |
|
| 522 | } |
|
| 523 | ||
| 524 | public function getCreateTableColumnCommentsSQL() |
|
| 525 | { |
|
| @@ 592-600 (lines=9) @@ | ||
| 589 | /** |
|
| 590 | * @group DBAL-374 |
|
| 591 | */ |
|
| 592 | public function testQuotedColumnInPrimaryKeyPropagation() |
|
| 593 | { |
|
| 594 | $table = new Table('`quoted`'); |
|
| 595 | $table->addColumn('create', 'string'); |
|
| 596 | $table->setPrimaryKey(array('create')); |
|
| 597 | ||
| 598 | $sql = $this->_platform->getCreateTableSQL($table); |
|
| 599 | self::assertEquals($this->getQuotedColumnInPrimaryKeySQL(), $sql); |
|
| 600 | } |
|
| 601 | ||
| 602 | abstract protected function getQuotedColumnInPrimaryKeySQL(); |
|
| 603 | abstract protected function getQuotedColumnInIndexSQL(); |
|
| @@ 610-618 (lines=9) @@ | ||
| 607 | /** |
|
| 608 | * @group DBAL-374 |
|
| 609 | */ |
|
| 610 | public function testQuotedColumnInIndexPropagation() |
|
| 611 | { |
|
| 612 | $table = new Table('`quoted`'); |
|
| 613 | $table->addColumn('create', 'string'); |
|
| 614 | $table->addIndex(array('create')); |
|
| 615 | ||
| 616 | $sql = $this->_platform->getCreateTableSQL($table); |
|
| 617 | self::assertEquals($this->getQuotedColumnInIndexSQL(), $sql); |
|
| 618 | } |
|
| 619 | ||
| 620 | public function testQuotedNameInIndexSQL() |
|
| 621 | { |
|
| @@ 620-628 (lines=9) @@ | ||
| 617 | self::assertEquals($this->getQuotedColumnInIndexSQL(), $sql); |
|
| 618 | } |
|
| 619 | ||
| 620 | public function testQuotedNameInIndexSQL() |
|
| 621 | { |
|
| 622 | $table = new Table('test'); |
|
| 623 | $table->addColumn('column1', 'string'); |
|
| 624 | $table->addIndex(array('column1'), '`key`'); |
|
| 625 | ||
| 626 | $sql = $this->_platform->getCreateTableSQL($table); |
|
| 627 | self::assertEquals($this->getQuotedNameInIndexSQL(), $sql); |
|
| 628 | } |
|
| 629 | ||
| 630 | /** |
|
| 631 | * @group DBAL-374 |
|
| @@ 162-169 (lines=8) @@ | ||
| 159 | self::assertEquals('DROP TABLE foobar', $this->_platform->getDropTableSQL('foobar')); |
|
| 160 | } |
|
| 161 | ||
| 162 | public function testGenerateTableWithAutoincrement() |
|
| 163 | { |
|
| 164 | $table = new \Doctrine\DBAL\Schema\Table('autoinc_table'); |
|
| 165 | $column = $table->addColumn('id', 'integer'); |
|
| 166 | $column->setAutoincrement(true); |
|
| 167 | ||
| 168 | self::assertEquals(array('CREATE TABLE autoinc_table (id SERIAL NOT NULL)'), $this->_platform->getCreateTableSQL($table)); |
|
| 169 | } |
|
| 170 | ||
| 171 | public function testGeneratesTypeDeclarationForIntegers() |
|
| 172 | { |
|