diff -r 000000000000 -r 4eba9c11703f web/Zend/Test/PHPUnit/Db/Connection.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/Zend/Test/PHPUnit/Db/Connection.php Mon Dec 13 18:29:26 2010 +0100 @@ -0,0 +1,149 @@ +_connection = $db; + $this->_schema = $schema; + } + + /** + * Close this connection. + * + * @return void + */ + public function close() + { + $this->_connection->closeConnection(); + } + + /** + * Creates a table with the result of the specified SQL statement. + * + * @param string $resultName + * @param string $sql + * @return PHPUnit_Extensions_Database_DataSet_ITable + */ + public function createQueryTable($resultName, $sql) + { + return new Zend_Test_PHPUnit_Db_DataSet_QueryTable($resultName, $sql, $this); + } + + /** + * Returns a Zend_Db Connection + * + * @return Zend_Db_Adapter_Abstract + */ + public function getConnection() + { + return $this->_connection; + } + + /** + * Returns a database metadata object that can be used to retrieve table + * meta data from the database. + * + * @return PHPUnit_Extensions_Database_DB_IMetaData + */ + public function getMetaData() + { + if($this->_metaData === null) { + $this->_metaData = new Zend_Test_PHPUnit_Db_Metadata_Generic($this->getConnection(), $this->getSchema()); + } + return $this->_metaData; + } + + /** + * Returns the schema for the connection. + * + * @return string + */ + public function getSchema() + { + return $this->_schema; + } + + /** + * Returns the command used to truncate a table. + * + * @return string + */ + public function getTruncateCommand() + { + return "DELETE"; + } +} \ No newline at end of file