diff -r 5b37998e522e -r 162c1de6545a web/lib/Zend/Test/PHPUnit/Db/DataSet/QueryDataSet.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Test/PHPUnit/Db/DataSet/QueryDataSet.php Fri Mar 11 15:05:35 2011 +0100 @@ -0,0 +1,90 @@ +databaseConnection = $databaseConnection; + } + + /** + * Add a Table dataset representation by specifiying an arbitrary select query. + * + * By default a select * will be done on the given tablename. + * + * @param string $tableName + * @param string|Zend_Db_Select $query + */ + public function addTable($tableName, $query = NULL) + { + if ($query === NULL) { + $query = $this->databaseConnection->getConnection()->select(); + $query->from($tableName, Zend_Db_Select::SQL_WILDCARD); + } + + if($query instanceof Zend_Db_Select) { + $query = $query->__toString(); + } + + $this->tables[$tableName] = new Zend_Test_PHPUnit_Db_DataSet_QueryTable($tableName, $query, $this->databaseConnection); + } +} \ No newline at end of file