| @@ 332-342 (lines=11) @@ | ||
| 329 | self::assertTrue($table->getIndex('my_idx')->spansColumns(array('id'))); |
|
| 330 | } |
|
| 331 | ||
| 332 | public function testAddPrimaryKeyColumnsAreExplicitlySetToNotNull() |
|
| 333 | { |
|
| 334 | $table = new Table("foo"); |
|
| 335 | $column = $table->addColumn("id", 'integer', array('notnull' => false)); |
|
| 336 | ||
| 337 | self::assertFalse($column->getNotnull()); |
|
| 338 | ||
| 339 | $table->setPrimaryKey(array('id')); |
|
| 340 | ||
| 341 | self::assertTrue($column->getNotnull()); |
|
| 342 | } |
|
| 343 | ||
| 344 | /** |
|
| 345 | * @group DDC-133 |
|
| @@ 586-596 (lines=11) @@ | ||
| 583 | /** |
|
| 584 | * @group DBAL-79 |
|
| 585 | */ |
|
| 586 | public function testTableHasPrimaryKey() |
|
| 587 | { |
|
| 588 | $table = new Table("test"); |
|
| 589 | ||
| 590 | self::assertFalse($table->hasPrimaryKey()); |
|
| 591 | ||
| 592 | $table->addColumn("foo", "integer"); |
|
| 593 | $table->setPrimaryKey(array("foo")); |
|
| 594 | ||
| 595 | self::assertTrue($table->hasPrimaryKey()); |
|
| 596 | } |
|
| 597 | ||
| 598 | /** |
|
| 599 | * @group DBAL-91 |
|
| @@ 666-676 (lines=11) @@ | ||
| 663 | /** |
|
| 664 | * @group DBAL-224 |
|
| 665 | */ |
|
| 666 | public function testDropPrimaryKey() |
|
| 667 | { |
|
| 668 | $table = new Table("test"); |
|
| 669 | $table->addColumn('id', 'integer'); |
|
| 670 | $table->setPrimaryKey(array('id')); |
|
| 671 | ||
| 672 | self::assertTrue($table->hasPrimaryKey()); |
|
| 673 | ||
| 674 | $table->dropPrimaryKey(); |
|
| 675 | self::assertFalse($table->hasPrimaryKey()); |
|
| 676 | } |
|
| 677 | ||
| 678 | /** |
|
| 679 | * @group DBAL-234 |
|