name = $name; $this->dbi = $dbi; $this->usr = $usr; $this->passwd = $passwd; } public function getTestName() { return $this->name; } public function init() { $this->db = MFDB::newInstance($this->dbi,$this->usr,$this->passwd); } public function testPreconditions() { if ($this->db instanceof MFDB) return; throw new Exception("no db object defined"); } public function testGetDbName() { if (!($result = $this->db->getDatabase())) throw new TestFailedException("database name returned empty string or null"); return $result; } public function testCreateTable() { $this->db->createTable($this->generateTableDef()); if (!$this->db->tableExists($this->testtablename)) throw new TestFailedException("database createTable or tableExists did not not work"); } public function testInsertData(){ if (!is_object($this->db->table($this->testtablename))) throw new TestFailedException("database table() did not return an object"); for ($i = 0; $i < 100; $i++) { try { $this->db->table($this->testtablename)->insert($this->generateDataRow(),array('colIndex')); } catch (MFDBSQLException $ex) { echo "Error with Query: ".$ex->getQuery(); throw $ex; } } } public function testSQLSelect(){ $result = $this->db->query("SELECT * FROM ".$this->db->escapeTableName($this->testtablename)); if (!is_object($result)) throw new TestFailedException("select did not return an result"); $rcount = $result->getRowCount(); $ccount = $result->getColumnCount(); $result->close(); if ($rcount != 100) throw new TestFailedException("invalid row count returned ({$rcount} != 100)"); if ($ccount != 21) throw new TestFailedException("invalid column count returned ({$ccount} != 21)"); return $ccount.':'.$rcount; } public function testSelectFetch(){ $result = $this->db->query("SELECT * FROM ".$this->db->escapeTableName($this->testtablename)); if (!is_object($result)) throw new TestFailedException("select did not return an result"); $errors = array(); $row = $result->fetchRow(); $row2 = $result->fetchRow(); if (!(is_bool($row[4]))) $errors[] = 'Row bool has invalid type'; else { if ($row[4] !== false) $errors[] = 'Row bool did not contain false on false'; if ($row2[4] !== true) $errors[] = 'Row bool did not contain true on true'; } if (!($row[18] instanceof DateTime || $row[18] instanceof MFDate)) $errors[] = 'Row date not DateTime or MFDate'; if (!($row[19] instanceof DateTime )) $errors[] = 'Row datetime not DateTime'; $array = $result->fetchArray(); $array2 = $result->fetchArray(); if (!(is_bool($array['col4']))) $errors[] = 'Array bool has invalid type'; else { if ($array['col4'] !== false) $errors[] = 'Array bool did not contain false on false'; if ($array2['col4'] !== true) $errors[] = 'Array bool did not contain true on true'; } if (!($array['coldate'] instanceof DateTime || $array['coldate'] instanceof MFDate)) $errors[] = 'Array date not DateTime or MFDate'; if (!($array['coldatetime'] instanceof DateTime)) $errors[] = 'Array datetime not DateTime'; $obj = $result->fetchObject(); $obj2 = $result->fetchObject(); if (!is_object($obj)) throw new TestFailedException("result is not an object"); if (!(is_bool($obj->col4))) $errors[] = 'Obj bool has invalid type'; else { if ($obj->col4 !== false) $errors[] = 'Obj bool did not contain false on false'; if ($obj2->col4 !== true) $errors[] = 'Obj bool did not contain true on true'; } if (!($obj->coldate instanceof DateTime || $obj->coldate instanceof MFDate)) $errors[] = 'Obj date not DateTime or MFDate'; if (!($obj->coldatetime instanceof DateTime)) $errors[] = 'Obj datetime not DateTime'; $obj = $result->fetchObject('stdClass'); if (!is_object($obj)) throw new TestFailedException("result is not an object"); $result->close(); if (count($errors) != 0) throw new TestFailedException("errors: ".implode(', ', $errors)); } public function testColumnInfo(){ try { $errors = array(); $result = $this->db->query("SELECT * FROM ".$this->db->escapeTableName($this->testtablename)); if (!is_object($result)) throw new TestFailedException("select did not return an result"); $columns = $result->getColumns(); if (!is_array($columns)) $errors[] = 'getColumns(): No array returned'; elseif (count($columns) != 21) $errors[] = 'getColumns(): Invalid array size ('.count($columns).')'; else { $errors = array_merge($errors, $this->validateColumnInfo($result)); } $result->close(); if (count($errors) != 0) { throw new TestFailedException("errors: ".implode(', ', $errors)); } } catch (MFImplementationException $e) { throw new TestFailedException($e->getMessage()); } catch (MFDBSQLException $e) { throw new TestFailedException("SQL ERROR: ".$e->getMessage()."\nSQL: ".$e->getQuery()); } } public function testTableColumnInfo(){ try { $errors = array(); $info = $this->db->table($this->testtablename)->getInfo(); $errors = array_merge($errors, $this->validateColumnInfo($info)); if (count($errors) != 0) { throw new TestFailedException("errors: ".implode(', ', $errors)); } } catch (MFImplementationException $e) { throw new TestFailedException($e->getMessage()); } catch (MFDBSQLException $e) { throw new TestFailedException("SQL ERROR: ".$e->getMessage()."\nSQL: ".$e->getQuery()); } } public function testSelectFetchAll(){ $result = $this->db->query("SELECT * FROM ".$this->db->escapeTableName($this->testtablename)); if (!is_object($result)) throw new TestFailedException("select did not return an result"); $rows = $result->fetchRowList(); if (count($rows) != 100) throw new TestFailedException("invalid row count returned (".count($arrays)." != 100)"); if (!array_key_exists(1, $rows[0])) throw new TestFailedException("column 1 missing"); $result->close(); $result = $this->db->query("SELECT * FROM ".$this->db->escapeTableName($this->testtablename)); $arrays = $result->fetchArrayList(); if (count($arrays) != 100) throw new TestFailedException("invalid array count returned (".count($arrays)." != 100)"); if (!array_key_exists('col1', $arrays[0])) throw new TestFailedException("column col1 missing"); $result->close(); $result = $this->db->query("SELECT * FROM ".$this->db->escapeTableName($this->testtablename)); $objs = $result->fetchObjectList(); if (count($objs) != 100) throw new TestFailedException("invalid object count returned (".count($objs)." != 100)"); if (!is_object($objs[0])) throw new TestFailedException("row is not an object missing"); $result->close(); $result = $this->db->query("SELECT * FROM ".$this->db->escapeTableName($this->testtablename)); $objs = $result->fetchObjectList('stdClass'); if (count($objs) != 100) throw new TestFailedException("invalid object count returned (".count($objs)." != 100)"); if (!is_object($objs[0])) throw new TestFailedException("row is not an object missing"); $result->close(); } public function testObjectSelect(){ if (!is_object($this->db->table($this->testtablename))) throw new TestFailedException("database table() did not return an object"); $result = $this->db->table($this->testtablename)->select(); if (!is_object($result)) throw new TestFailedException("select did not return an result"); $rcount = $result->getRowCount(); $ccount = $result->getColumnCount(); $result->close(); if ($rcount != 100) throw new TestFailedException("invalid row count returned ({$rcount} != 100)"); if ($ccount != 21) throw new TestFailedException("invalid column count returned ({$ccount} != 21)"); return $ccount.':'.$rcount; } public function testSQLSelectWithLimit(){ $result = $this->db->query("SELECT * FROM ".$this->db->escapeTableName($this->testtablename),50); if (!is_object($result)) throw new TestFailedException("select did not return an result"); $rcount = $result->getRowCount(); $ccount = $result->getColumnCount(); $result->close(); if ($rcount != 50) throw new TestFailedException("invalid row count returned ({$rcount} != 50)"); if ($ccount != 21) throw new TestFailedException("invalid column count returned ({$ccount} != 21)"); return $ccount.':'.$rcount; } public function testSQLSelectWithLimitAndSkip(){ $result = $this->db->query("SELECT * FROM ".$this->db->escapeTableName($this->testtablename),50,10); if (!is_object($result)) throw new TestFailedException("select did not return an result"); $rcount = $result->getRowCount(); $ccount = $result->getColumnCount(); $row = $result->fetchArray(); $result->close(); if ($rcount != 50) throw new TestFailedException("invalid row count returned ({$rcount} != 40)"); if ($ccount != 21) throw new TestFailedException("invalid column count returned ({$ccount} != 21)"); if ($row['col1'] != 110) throw new TestFailedException("invalid column value of first row returned ({$row['col1']} != 110)"); return 'col1 of 1st row:'.$row['col1']; } public function testUpdateCount(){ $result = $this->db->query("UPDATE ".$this->db->escapeTableName($this->testtablename)." SET colenum='b'"); $count = $this->db->getAffectedRowCount(); if ($count != 100) throw new TestFailedException("invalid row count returned ({$count} != 100)"); return $count; } public function testMultiquery(){ $this->db->multiquery( array( "SELECT * FROM ".$this->db->escapeTableName($this->testtablename), "SELECT * FROM ".$this->db->escapeTableName($this->testtablename) ),false); } public function testPreparedStatement(){ $stmt = $this->db->prepareStatement("SELECT * FROM ".$this->db->escapeTableName($this->testtablename)); if (!is_object($stmt)) throw new TestFailedException("prepare did not return an statement"); $stmt->execute(); $stmt->free(); $stmt = $this->db->prepareStatement("SELECT * FROM ".$this->db->escapeTableName($this->testtablename)." WHERE col1execute(array('110')); $c1 = $stmt->getRowCount(); $stmt->free(); $r2 = $stmt->execute(array('120')); $c2 = $stmt->getRowCount(); $stmt->free(); $stmt->close(); if ($r1 !== true || $c1 != 10 || $r2 !== true || $c2 != 20) throw new TestFailedException("prepare did not return correct results ($r1 : true | $c1 : 10 | $r2 : true || $c2 : 20)"); $list = $this->db->getObjectListP("SELECT * FROM ".$this->db->escapeTableName($this->testtablename)." WHERE col1db->table($this->testtablename))) throw new TestFailedException("database table() did not return an object"); $this->db->table($this->testtablename)->delete(array('col1' => 115)); } public function testTransactionSupport() { if (!is_object($this->db->table($this->testtablename))) throw new TestFailedException("database table() did not return an object"); if ($this->db->isTransactionSupported()) { $this->db->startTransaction(); $this->db->table($this->testtablename)->delete(array('col1' => 114)); $this->db->rollback(); $result = $this->db->table($this->testtablename)->select(array('col1' => 114)); if ($result->getRowCount() == 0) { $result->close(); throw new TestFailedException("transaction cancled, but row is deleted"); } $result->close(); $this->db->startTransaction(); $this->db->table($this->testtablename)->delete(array('col1' => 116)); $this->db->commit(); } else return 'no transaction support'; } public function testBlob(){ try { if (!is_object($this->db->table($this->testtablename))) throw new TestFailedException("database table() did not return an object"); $this->db->table($this->testtablename)->delete(array()); $row = $this->generateDataRowWithBlob(); $this->db->table($this->testtablename)->insert($this->generateDataRowWithBlob(),array('colIndex')); $row = $this->db->table($this->testtablename)->getArray(); if (md5_file(__FILE__) != md5($row['colblob'])) throw new TestFailedException("blob value not correctly inserted or readed"); } catch (MFDBSQLException $e) { throw new TestFailedException("SQL ERROR: ".$e->getMessage()."\nSQL: ".$e->getQuery()); } } public function testAlterTableRenameColumn() { try { if (!is_object($this->db->table($this->testtablename))) throw new TestFailedException("database table() did not return an object"); $this->db->table($this->testtablename)->renameColumn('col5', 'col5a'); sleep(1); $info = $this->db->table($this->testtablename)->getInfo()->getColumnInfo('col5a'); $this->db->table($this->testtablename)->renameColumn('col5a', 'col5'); if (empty($info) || $info->getName() != 'col5a') throw new TestFailedException('Column rename failed'); } catch (MFImplementationException $e) { throw new TestFailedException($e->getMessage()); } catch (MFDBSQLException $e) { throw new TestFailedException("SQL ERROR: "+$e->getMessage()+"\nSQL: ".$e->getQuery()); } } public function testAlterTableModifyColumn() { try { if (!is_object($this->db->table($this->testtablename))) throw new TestFailedException("database table() did not return an object"); $this->db->table($this->testtablename)->alterColumn('col1', new MFDBColumnInfo('col1new',MFDBColumnInfo::TYPE_FLOAT,-1)); } catch (MFImplementationException $e) { throw new TestFailedException($e->getMessage()); } catch (MFDBSQLException $e) { throw new TestFailedException("SQL ERROR: ".$e->getMessage()."\nSQL: ".$e->getQuery()); } } public function testAlterTableAddColumn() { try { if (!is_object($this->db->table($this->testtablename))) throw new TestFailedException("database table() did not return an object"); $errors = array(); $this->db->table($this->testtablename)->addColumn(new MFDBColumnInfo('col97',MFDBColumnInfo::TYPE_DATETIME,-1,array(MFDBColumnInfo::P_ALLOW_NULL))); $this->db->table($this->testtablename)->addColumn(new MFDBColumnInfo('col98',MFDBColumnInfo::TYPE_INT,-1,array(MFDBColumnInfo::P_ALLOW_NULL))); $this->db->table($this->testtablename)->addColumn(new MFDBColumnInfo('col99',MFDBColumnInfo::TYPE_VCHAR,20,array(MFDBColumnInfo::P_ALLOW_NULL))); $info = $this->db->table($this->testtablename)->getInfo()->getColumnInfo('col97'); if (empty($info) || $info->getName() != 'col97' || $info->getType() != MFDBColumnInfo::TYPE_DATETIME) $errors[] = empty($info) ? 'col97 not found' : 'col97 incorrect'; $info = $this->db->table($this->testtablename)->getInfo()->getColumnInfo('col98'); if (empty($info) || $info->getName() != 'col98' || $info->getType() != MFDBColumnInfo::TYPE_INT) $errors[] = empty($info) ? 'col98 not found' : 'col98 incorrect'; $info = $this->db->table($this->testtablename)->getInfo()->getColumnInfo('col99'); if (empty($info) || $info->getName() != 'col99' || $info->getType() != MFDBColumnInfo::TYPE_VCHAR) $errors[] = empty($info) ? 'col99 not found' : 'col99 incorrect'; if (count($errors) > 0) throw new TestFailedException('Column add failed: '.implode(', ', $errors)); } catch (MFImplementationException $e) { throw new TestFailedException($e->getMessage()); } catch (MFDBSQLException $e) { throw new TestFailedException("SQL ERROR: ".$e->getMessage()."\nSQL: ".$e->getQuery()); } } public function testAlterTableDropColumn() { try { if (!is_object($this->db->table($this->testtablename))) throw new TestFailedException("database table() did not return an object"); $this->db->table($this->testtablename)->removeColumn('col5'); } catch (MFImplementationException $e) { throw new TestFailedException($e->getMessage()); } } public function testDropTable() { if (!is_object($this->db->table($this->testtablename))) throw new TestFailedException("database table() did not return an object"); $this->db->dropTable($this->testtablename); } public function testGetQueryCount() { if (!is_numeric($this->db->getQueryCount())) throw new TestFailedException("invalid query count result"); $this->assert(($result = $this->db->getQueryCount())>0, "invalid query count"); return $result; } public function cleanup() { if (is_object($this->db)) { try { if ($this->db->tableExists($this->testtablename)) $this->db->dropTable($this->testtablename); } catch (Exception $e) {} $this->db->close(); } } private function generateTableDef() { $table = new MFDBTableInfo($this->testtablename); $table->addColumn(new MFDBColumnInfo('colIndex',MFDBColumnInfo::TYPE_INT,-1,array(MFDBColumnInfo::P_AUTONUM))); $table->addColumn(new MFDBColumnInfo('col1',MFDBColumnInfo::TYPE_INT,-1)); $table->addColumn(new MFDBColumnInfo('col2',MFDBColumnInfo::TYPE_DOUBLE,-1)); $table->addColumn(new MFDBColumnInfo('col3',MFDBColumnInfo::TYPE_CHAR,20)); $table->addColumn(new MFDBColumnInfo('col4',MFDBColumnInfo::TYPE_BOOLEAN,-1)); $table->addColumn(new MFDBColumnInfo('col5',MFDBColumnInfo::TYPE_CHAR,25,array(),NULL,NULL,'abc')); $table->addColumn(new MFDBColumnInfo('coltiny',MFDBColumnInfo::TYPE_TINY,-1,array(MFDBColumnInfo::P_ALLOW_NULL))); $table->addColumn(new MFDBColumnInfo('colshort',MFDBColumnInfo::TYPE_SHORT,-1,array(MFDBColumnInfo::P_ALLOW_NULL))); $table->addColumn(new MFDBColumnInfo('colint',MFDBColumnInfo::TYPE_INT,-1,array(MFDBColumnInfo::P_ALLOW_NULL))); $table->addColumn(new MFDBColumnInfo('collong',MFDBColumnInfo::TYPE_LONG,-1,array(MFDBColumnInfo::P_ALLOW_NULL))); $table->addColumn(new MFDBColumnInfo('colreal',MFDBColumnInfo::TYPE_FLOAT,-1,array(MFDBColumnInfo::P_ALLOW_NULL))); $table->addColumn(new MFDBColumnInfo('coldouble',MFDBColumnInfo::TYPE_DOUBLE,-1,array(MFDBColumnInfo::P_ALLOW_NULL))); $table->addColumn(new MFDBColumnInfo('coldec',MFDBColumnInfo::TYPE_DECIMAL,array(2,2),array(MFDBColumnInfo::P_ALLOW_NULL))); $table->addColumn(new MFDBColumnInfo('colchar',MFDBColumnInfo::TYPE_CHAR,64,array(MFDBColumnInfo::P_ALLOW_NULL))); $table->addColumn(new MFDBColumnInfo('colvchar',MFDBColumnInfo::TYPE_VCHAR,64,array(MFDBColumnInfo::P_ALLOW_NULL))); $table->addColumn(new MFDBColumnInfo('coltext',MFDBColumnInfo::TYPE_TEXT,-1,array(MFDBColumnInfo::P_ALLOW_NULL))); $table->addColumn(new MFDBColumnInfo('colbin',MFDBColumnInfo::TYPE_BINARY,64,array(MFDBColumnInfo::P_ALLOW_NULL))); $table->addColumn(new MFDBColumnInfo('colblob',MFDBColumnInfo::TYPE_BLOB,-1,array(MFDBColumnInfo::P_ALLOW_NULL))); $table->addColumn(new MFDBColumnInfo('coldate',MFDBColumnInfo::TYPE_DATE,-1,array(MFDBColumnInfo::P_ALLOW_NULL))); $table->addColumn(new MFDBColumnInfo('coldatetime',MFDBColumnInfo::TYPE_DATETIME,-1,array(MFDBColumnInfo::P_ALLOW_NULL))); $table->addColumn(new MFDBColumnInfo('colenum',MFDBColumnInfo::TYPE_ENUM,-1,array(MFDBColumnInfo::P_ALLOW_NULL,'values(a,b,c,d)'))); $table->setPrimary(array('colIndex')); return $table; } private $rowtestnum = 100; private $rowtestbool = true; private function generateDataRow() { $row = new stdClass(); $row->colIndex = MFDBSQLFunction::fDefault(); $row->col1 = $this->rowtestnum++; $row->col2 = 1.23; $row->col3 = 'Char4711'; $row->col4 = ($this->rowtestbool = !$this->rowtestbool); $row->col5 = 'Char 54321'; $row->coltiny = 123; $row->colshort = 12341; $row->colint = 1234123412; $row->collong = 123412341234; $row->colreal = 0.11; $row->coldouble = 0.1111; $row->coldec = 0; $row->colchar = '12341gfhd56'; $row->colvchar = '356sdft'; $row->coltext = 'w45s5w45w3'; $row->colbin = NULL; $row->colblob = NULL; $row->coldate = new MFDate(); $row->coldatetime = new DateTime(); $row->colenum = 'a'; return $row; } private function generateDataRowWithBlob() { $row = $this->generateDataRow(); $row->colblob = new MFFile(__FILE__); return $row; } private function validateColumnInfo($result) { $errors = array(); $info = $result->getColumnInfo(6); if (!is_object($info)) throw new TestFailedException("getColumnInfo did not return an object for column 6"); if ($info->getName() != 'coltiny') $errors[] = 'coltiny: wrong name returned:'.$info->getName(); if ($info->getType() != MFDBColumnInfo::TYPE_TINY) $errors[] = 'coltiny: wrong type returned:'.$info->getType(); $info = $result->getColumnInfo(7); if (!is_object($info)) throw new TestFailedException("getColumnInfo did not return an object for column 7"); if ($info->getName() != 'colshort') $errors[] = 'colshort: wrong name returned:'.$info->getName(); if ($info->getType() != MFDBColumnInfo::TYPE_SHORT) $errors[] = 'colshort: wrong type returned:'.$info->getType(); $info = $result->getColumnInfo(8); if (!is_object($info)) throw new TestFailedException("getColumnInfo did not return an object for column 8"); if ($info->getName() != 'colint') $errors[] = 'colint: wrong name returned:'.$info->getName(); if ($info->getType() != MFDBColumnInfo::TYPE_INT) $errors[] = 'colint: wrong type returned:'.$info->getType(); $info = $result->getColumnInfo(9); if (!is_object($info)) throw new TestFailedException("getColumnInfo did not return an object for column 9"); if ($info->getName() != 'collong') $errors[] = 'collong: wrong name returned:'.$info->getName(); if ($info->getType() != MFDBColumnInfo::TYPE_LONG) $errors[] = 'collong: wrong type returned:'.$info->getType(); $info = $result->getColumnInfo(10); if (!is_object($info)) throw new TestFailedException("getColumnInfo did not return an object for column 10"); if ($info->getName() != 'colreal') $errors[] = 'colreal: wrong name returned:'.$info->getName(); if ($info->getType() != MFDBColumnInfo::TYPE_FLOAT) $errors[] = 'colreal: wrong type returned:'.$info->getType(); /* $info = $result->getColumnInfo('coldec'); if (!is_object($info)) throw new TestFailedException("getColumnInfo did not return an object"); if ($info->getName() != 'coldec') $errors[] = 'coldec: wrong name returned:'.$info->getName(); if ($info->getType() != MFDBColumnInfo::TYPE_DECIMAL) $errors[] = 'coldec: wrong type returned:'.$info->getType(); */ $info = $result->getColumnInfo('colchar'); if (!is_object($info)) throw new TestFailedException("getColumnInfo did not return an object for column colchar"); if ($info->getName() != 'colchar') $errors[] = 'colchar: wrong name returned:'.$info->getName(); if ($info->getType() != MFDBColumnInfo::TYPE_CHAR) $errors[] = 'colchar: wrong type returned:'.$info->getType(); $info = $result->getColumnInfo('colvchar'); if (!is_object($info)) throw new TestFailedException("getColumnInfo did not return an object for column colvchar"); if ($info->getName() != 'colvchar') $errors[] = 'colvchar: wrong name returned:'.$info->getName(); if ($info->getType() != MFDBColumnInfo::TYPE_VCHAR) $errors[] = 'colvchar: wrong type returned:'.$info->getType(); $info = $result->getColumnInfo('coltext'); if (!is_object($info)) throw new TestFailedException("getColumnInfo did not return an object for column coltext"); if ($info->getName() != 'coltext') $errors[] = 'coltext: wrong name returned:'.$info->getName(); if ($info->getType() != MFDBColumnInfo::TYPE_TEXT) $errors[] = 'coltext: wrong type returned:'.$info->getType(); $info = $result->getColumnInfo('colbin'); if (!is_object($info)) throw new TestFailedException("getColumnInfo did not return an object for column colbin"); if ($info->getName() != 'colbin') $errors[] = 'colbin: wrong name returned:'.$info->getName(); if ($info->getType() != MFDBColumnInfo::TYPE_BINARY) $errors[] = 'colbin: wrong type returned:'.$info->getType(); $info = $result->getColumnInfo('colblob'); if (!is_object($info)) throw new TestFailedException("getColumnInfo did not return an object for column colblob"); if ($info->getName() != 'colblob') $errors[] = 'colblob: wrong name returned:'.$info->getName(); if ($info->getType() != MFDBColumnInfo::TYPE_BLOB) $errors[] = 'colblob: wrong type returned:'.$info->getType(); $info = $result->getColumnInfo('coldate'); if (!is_object($info)) throw new TestFailedException("getColumnInfo did not return an object for column coldate"); if ($info->getName() != 'coldate') $errors[] = 'coldate: wrong name returned:'.$info->getName(); if ($info->getType() != MFDBColumnInfo::TYPE_DATE) $errors[] = 'coldate: wrong type returned:'.$info->getType(); $info = $result->getColumnInfo('coldatetime'); if (!is_object($info)) throw new TestFailedException("getColumnInfo did not return an object for column coldatetime"); if ($info->getName() != 'coldatetime') $errors[] = 'coldatetime: wrong name returned:'.$info->getName(); if ($info->getType() != MFDBColumnInfo::TYPE_DATETIME) $errors[] = 'coldatetime: wrong type returned:'.$info->getType(); $info = $result->getColumnInfo('colenum'); if (!is_object($info)) throw new TestFailedException("getColumnInfo did not return an object for column colenum"); if ($info->getName() != 'colenum') $errors[] = 'colenum: wrong name returned:'.$info->getName(); if ($info->getType() != MFDBColumnInfo::TYPE_ENUM) $errors[] = 'colenum: wrong type returned:'.$info->getType(); return $errors; } }