|
@@ 575-591 (lines=17) @@
|
| 572 |
|
$views = $this->_sm->listViews(); |
| 573 |
|
} |
| 574 |
|
|
| 575 |
|
public function testAutoincrementDetection() |
| 576 |
|
{ |
| 577 |
|
if (!$this->_sm->getDatabasePlatform()->supportsIdentityColumns()) { |
| 578 |
|
$this->markTestSkipped('This test is only supported on platforms that have autoincrement'); |
| 579 |
|
} |
| 580 |
|
|
| 581 |
|
$table = new Table('test_autoincrement'); |
| 582 |
|
$table->setSchemaConfig($this->_sm->createSchemaConfig()); |
| 583 |
|
$table->addColumn('id', 'integer', array('autoincrement' => true)); |
| 584 |
|
$table->setPrimaryKey(array('id')); |
| 585 |
|
|
| 586 |
|
$this->_sm->createTable($table); |
| 587 |
|
|
| 588 |
|
$inferredTable = $this->_sm->listTableDetails('test_autoincrement'); |
| 589 |
|
$this->assertTrue($inferredTable->hasColumn('id')); |
| 590 |
|
$this->assertTrue($inferredTable->getColumn('id')->getAutoincrement()); |
| 591 |
|
} |
| 592 |
|
|
| 593 |
|
/** |
| 594 |
|
* @group DBAL-792 |
|
@@ 596-613 (lines=18) @@
|
| 593 |
|
/** |
| 594 |
|
* @group DBAL-792 |
| 595 |
|
*/ |
| 596 |
|
public function testAutoincrementDetectionMulticolumns() |
| 597 |
|
{ |
| 598 |
|
if (!$this->_sm->getDatabasePlatform()->supportsIdentityColumns()) { |
| 599 |
|
$this->markTestSkipped('This test is only supported on platforms that have autoincrement'); |
| 600 |
|
} |
| 601 |
|
|
| 602 |
|
$table = new Table('test_not_autoincrement'); |
| 603 |
|
$table->setSchemaConfig($this->_sm->createSchemaConfig()); |
| 604 |
|
$table->addColumn('id', 'integer'); |
| 605 |
|
$table->addColumn('other_id', 'integer'); |
| 606 |
|
$table->setPrimaryKey(array('id', 'other_id')); |
| 607 |
|
|
| 608 |
|
$this->_sm->createTable($table); |
| 609 |
|
|
| 610 |
|
$inferredTable = $this->_sm->listTableDetails('test_not_autoincrement'); |
| 611 |
|
$this->assertTrue($inferredTable->hasColumn('id')); |
| 612 |
|
$this->assertFalse($inferredTable->getColumn('id')->getAutoincrement()); |
| 613 |
|
} |
| 614 |
|
|
| 615 |
|
/** |
| 616 |
|
* @group DDC-887 |