public function testGetDatabaseTable()
 {
     $field1 = new PropertyField('field1', 'type');
     $field2 = new PropertyField('field2', 'type');
     $field3 = new HasManyField('field3', 'model');
     $index = new Index('field2', array($field2));
     $modelTable = new ModelTable('table');
     $modelTable->addField($field1);
     $modelTable->addField($field2);
     $modelTable->addField($field3);
     $modelTable->addIndex($index);
     $pk = new PropertyField('id', 'pk');
     $pk->setIsAutonumbering(true);
     $pk->setIsPrimaryKey(true);
     $databaseTable = new Table('table');
     $databaseTable->addField($pk);
     $databaseTable->addField($field1);
     $databaseTable->addField($field2);
     $databaseTable->addIndex($index);
     $this->assertEquals($databaseTable, $modelTable->getDatabaseTable());
 }