sebastianbergmann / dbunit
- Source
- Commits
- Network (4)
- Issues (12)
- Graphs
-
Branch:
master
click here to add a description
click here to add a homepage
-
Create a sorted dataset to allow for comparing datasets without considering order of data.
Comments
Please log in to comment. -
0 comments Created 3 months ago by sebastianbergmannError on delete data with hierarchical relationshipbug -
0 comments Created 3 months ago by sebastianbergmannBinary fields in database are not recoded to anythingbug -
0 comments Created 3 months ago by sebastianbergmannCase sensitive problems on XML Datasetbug -
0 comments Created 3 months ago by sebastianbergmannMultiple data set files support in PHPUnit_Extensions_Database_TestCasefeature request -
0 comments Created 3 months ago by sebastianbergmannSequences support in XML DataSetfeature request -
0 comments Created 3 months ago by sebastianbergmannMultiple character set support for DbUnitfeature request -
0 comments Created 3 months ago by sebastianbergmannAdd ODBC support for DbUnitfeature request -
0 comments Created 3 months ago by sebastianbergmannChanges to DBUnit extension to allow the use of XInclude in xml filesfeature request -
Extensions\Database\DataSet\QueryTable::createTableMetaData()
throws error if table is empty.Basically empty tables causes QueryTable::data to be empty => no array keys => error
How do I submit a patch? ^_^
Extensions\Database\DataSet\QueryTable : Line 162
protected function createTableMetaData() { if ($this->tableMetaData === NULL) { $this->loadData(); // if some rows are in the table $columns = array(); if (isset($this->data[0])) // get column names from data $columns = array_keys($this->data[0]); else { // if no rows found, get column names from database $pdoStatement = $this->databaseConnection->getConnection()->prepare("SELECT column_name FROM information_schema.COLUMNS WHERE table_schema=:schema AND table_name=:table"); $pdoStatement->execute(array( "table" => $this->tableName, "schema" => $this->databaseConnection->getSchema() )); $columns = $pdoStatement->fetchAll(PDO::FETCH_COLUMN, 0); } // create metadata $this->tableMetaData = new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData($this->tableName, $columns); } }Comments
Please log in to comment. -
As described here http://www.sqlite.org/autoinc.html SQLite AUTOINCREMENT value is not reset with a simple "DELETE FROM tablename".
This causes a problem in PHPUnit_Extensions_Database_Operation_Truncate since SQLite requires two SQL commands to empty a table and reset the autoincrement value.
In PHPUnit_Extensions_Database_DB_MetaData_Sqlite there is a
protected $truncateCommand = 'DELETE FROM';"PHPUnit_Extensions_Database_Operation_Truncate::execute()" should be slightly changed to allow PHPUnit_Extensions_Database_DB_MetaData_Sqlite::$truncateCommand to be an array like:
protected $truncateCommand = array('DELETE FROM' , 'DELETE FROM sqlite_sequence WHERE name = ?');Comments
Please log in to comment.


