connection = $connection; $this->generation = new TableObjectGeneration($connection, $this->tableName); $this->createTestTable(); } function createTestTable() { $sql = "DROP TABLE if exists {$this->tableName};"; $query = new QueryBuilder(); $query->raw($sql); $data = $this->connection->defer()->query($query); $this->assertTrue($data->getResult()); $tableDDL = new Table($this->tableName); $tableDDL->colInt('id', 11)->setIsPrimaryKey()->setIsAutoIncrement(); $tableDDL->colVarChar('name', 255); $tableDDL->colTinyInt('age', 1); $tableDDL->colDateTime('addTime'); $tableDDL->colTinyInt('state', 1); $tableDDL->setIfNotExists(); $sql = $tableDDL->__createDDL(); $query->raw($sql); $data = $this->connection->defer()->query($query); $this->assertTrue($data->getResult()); } function testGetTableInfo() { $data = $this->generation->getTableColumnsInfo(); $this->assertIsArray($data); } }