|
@@ 590-606 (lines=17) @@
|
| 587 |
|
self::assertTrue($this->hasElementWithName($this->_sm->listViews(), $name)); |
| 588 |
|
} |
| 589 |
|
|
| 590 |
|
public function testAutoincrementDetection() |
| 591 |
|
{ |
| 592 |
|
if (!$this->_sm->getDatabasePlatform()->supportsIdentityColumns()) { |
| 593 |
|
$this->markTestSkipped('This test is only supported on platforms that have autoincrement'); |
| 594 |
|
} |
| 595 |
|
|
| 596 |
|
$table = new Table('test_autoincrement'); |
| 597 |
|
$table->setSchemaConfig($this->_sm->createSchemaConfig()); |
| 598 |
|
$table->addColumn('id', 'integer', array('autoincrement' => true)); |
| 599 |
|
$table->setPrimaryKey(array('id')); |
| 600 |
|
|
| 601 |
|
$this->_sm->createTable($table); |
| 602 |
|
|
| 603 |
|
$inferredTable = $this->_sm->listTableDetails('test_autoincrement'); |
| 604 |
|
self::assertTrue($inferredTable->hasColumn('id')); |
| 605 |
|
self::assertTrue($inferredTable->getColumn('id')->getAutoincrement()); |
| 606 |
|
} |
| 607 |
|
|
| 608 |
|
/** |
| 609 |
|
* @group DBAL-792 |
|
@@ 611-628 (lines=18) @@
|
| 608 |
|
/** |
| 609 |
|
* @group DBAL-792 |
| 610 |
|
*/ |
| 611 |
|
public function testAutoincrementDetectionMulticolumns() |
| 612 |
|
{ |
| 613 |
|
if (!$this->_sm->getDatabasePlatform()->supportsIdentityColumns()) { |
| 614 |
|
$this->markTestSkipped('This test is only supported on platforms that have autoincrement'); |
| 615 |
|
} |
| 616 |
|
|
| 617 |
|
$table = new Table('test_not_autoincrement'); |
| 618 |
|
$table->setSchemaConfig($this->_sm->createSchemaConfig()); |
| 619 |
|
$table->addColumn('id', 'integer'); |
| 620 |
|
$table->addColumn('other_id', 'integer'); |
| 621 |
|
$table->setPrimaryKey(array('id', 'other_id')); |
| 622 |
|
|
| 623 |
|
$this->_sm->createTable($table); |
| 624 |
|
|
| 625 |
|
$inferredTable = $this->_sm->listTableDetails('test_not_autoincrement'); |
| 626 |
|
self::assertTrue($inferredTable->hasColumn('id')); |
| 627 |
|
self::assertFalse($inferredTable->getColumn('id')->getAutoincrement()); |
| 628 |
|
} |
| 629 |
|
|
| 630 |
|
/** |
| 631 |
|
* @group DDC-887 |