| @@ 330-340 (lines=11) @@ | ||
| 327 | $this->assertTrue($table->getIndex('my_idx')->spansColumns(array('id'))); |
|
| 328 | } |
|
| 329 | ||
| 330 | public function testAddPrimaryKey_ColumnsAreExplicitlySetToNotNull() |
|
| 331 | { |
|
| 332 | $table = new Table("foo"); |
|
| 333 | $column = $table->addColumn("id", 'integer', array('notnull' => false)); |
|
| 334 | ||
| 335 | $this->assertFalse($column->getNotnull()); |
|
| 336 | ||
| 337 | $table->setPrimaryKey(array('id')); |
|
| 338 | ||
| 339 | $this->assertTrue($column->getNotnull()); |
|
| 340 | } |
|
| 341 | ||
| 342 | /** |
|
| 343 | * @group DDC-133 |
|
| @@ 638-648 (lines=11) @@ | ||
| 635 | /** |
|
| 636 | * @group DBAL-79 |
|
| 637 | */ |
|
| 638 | public function testTableHasPrimaryKey() |
|
| 639 | { |
|
| 640 | $table = new Table("test"); |
|
| 641 | ||
| 642 | $this->assertFalse($table->hasPrimaryKey()); |
|
| 643 | ||
| 644 | $table->addColumn("foo", "integer"); |
|
| 645 | $table->setPrimaryKey(array("foo")); |
|
| 646 | ||
| 647 | $this->assertTrue($table->hasPrimaryKey()); |
|
| 648 | } |
|
| 649 | ||
| 650 | /** |
|
| 651 | * @group DBAL-91 |
|
| @@ 714-724 (lines=11) @@ | ||
| 711 | /** |
|
| 712 | * @group DBAL-224 |
|
| 713 | */ |
|
| 714 | public function testDropPrimaryKey() |
|
| 715 | { |
|
| 716 | $table = new Table("test"); |
|
| 717 | $table->addColumn('id', 'integer'); |
|
| 718 | $table->setPrimaryKey(array('id')); |
|
| 719 | ||
| 720 | $this->assertTrue($table->hasPrimaryKey()); |
|
| 721 | ||
| 722 | $table->dropPrimaryKey(); |
|
| 723 | $this->assertFalse($table->hasPrimaryKey()); |
|
| 724 | } |
|
| 725 | ||
| 726 | /** |
|
| 727 | * @group DBAL-234 |
|