/** * Set the primary key if this tables PK is specified. */ protected function createPrimaryKey() { if ($this->table->getPrimaryKey() !== null) { $this->content .= " \$table->primary('" . $this->table->getPrimaryKey() . "');\n"; } }
public function testSetPrimaryKey() { $tbl = new Table("test_table", 'MyISAM'); $tbl->setPrimaryKey("primary test"); $this->assertEquals("primary test", $tbl->getPrimaryKey()); }